1/*
2 * L4_MABX.c
3 *
4 * Code generation for model "L4_MABX".
5 *
6 * Model version : 1.894
7 * Simulink Coder version : 8.14 (R2018a) 06-Feb-2018
8 * C source code generated on : Mon Feb 3 15:07:24 2020
9 *
10 * Target selection: rti1401.tlc
11 * Note: GRT includes extra infrastructure and instrumentation for prototyping
12 * Embedded hardware selection: Custom Processor->Custom
13 * Code generation objectives: Unspecified
14 * Validation result: Not run
15 */
16
17#include "L4_MABX_trc_ptr.h"
18#include "L4_MABX.h"
19#include "L4_MABX_private.h"
20
21/* Named constants for Chart: '<S79>/Chart' */
22#define L4_MABX_IN_Init ((uint8_T)1U)
23#define L4_MABX_IN_NO_ACTIVE_CHILD ((uint8_T)0U)
24#define L4_MABX_IN_OperatorDisabled ((uint8_T)2U)
25#define L4_MABX_IN_OperatorEnabled ((uint8_T)3U)
26
27/* Named constants for Chart: '<S211>/Relay_control_state_machine' */
28#define L4_MABX_IN_IGN_RELAY_LATCH ((uint8_T)1U)
29#define L4_MABX_IN_IGN_RELAY_UNLATCH ((uint8_T)1U)
30#define L4_MABX_IN_INITIAL ((uint8_T)1U)
31#define L4_MABX_IN_INV_RELAY_LATCH ((uint8_T)2U)
32#define L4_MABX_IN_INV_RELAY_UNLATCH ((uint8_T)2U)
33#define L4_MABX_IN_MABX_RELAY_LATCH ((uint8_T)3U)
34#define L4_MABX_IN_MABX_RELAY_UNLATCH ((uint8_T)3U)
35#define L4_MABX_IN_POWER_DOWN_ROUTINE ((uint8_T)2U)
36#define L4_MABX_IN_POWER_UP_ROUTINE ((uint8_T)3U)
37#define L4_MABX_IN_SENSOR_RELAY_LATCH ((uint8_T)4U)
38#define L4_MABX_IN_SENSOR_RELAY_UNLATCH ((uint8_T)4U)
39#define L4_MABX_IN_WAIT ((uint8_T)5U)
40
41/* Named constants for Chart: '<S283>/Chart' */
42#define L4_MABX_IN_OneLane ((uint8_T)1U)
43#define L4_MABX_IN_OneLane1 ((uint8_T)2U)
44#define L4_MABX_IN_TwoLanes ((uint8_T)3U)
45#define L4_MABX_IN_TwoLanes1 ((uint8_T)4U)
46#define L4_MABX_IN_ZeroLanes ((uint8_T)5U)
47#define L4_MABX_IN_ZeroLanes1 ((uint8_T)6U)
48#define L4_MABX_IN_init_h ((uint8_T)7U)
49
50/* Named constants for Chart: '<S763>/Health State Machine PWM Sensor 1' */
51#define L4_MABX_IN_ERROR ((uint8_T)1U)
52#define L4_MABX_IN_FAILURE_DETECTED ((uint8_T)1U)
53#define L4_MABX_IN_NO_FAILURE ((uint8_T)2U)
54#define L4_MABX_IN_PENDING ((uint8_T)2U)
55
56/* Named constants for Chart: '<S845>/Chart' */
57#define L4_MABX_IN_DiagPassed ((uint8_T)1U)
58#define L4_MABX_IN_SwitchOff ((uint8_T)2U)
59#define L4_MABX_IN_SwitchOn ((uint8_T)3U)
60#define L4_MABX_IN_init_o ((uint8_T)4U)
61
62/* Named constants for Chart: '<S859>/Chart' */
63#define L4_MABX_IN_CheckPacketCount ((uint8_T)1U)
64#define L4_MABX_IN_Init_k ((uint8_T)2U)
65#define L4_MABX_IN_InterframeDelay ((uint8_T)3U)
66#define L4_MABX_IN_InterframeDelay1 ((uint8_T)4U)
67#define L4_MABX_IN_SendTPCM ((uint8_T)5U)
68#define L4_MABX_IN_SendTPDT ((uint8_T)6U)
69#define L4_MABX_IN_StartMsg ((uint8_T)7U)
70#define L4_MABX_IN_WaitForNextPeriod ((uint8_T)8U)
71
72/* Exported block signals */
73real_T GLB_Absolute_Timestamp; /* '<S417>/Rate Transition' */
74real_T ReAX_ActualHandwheelPos; /* '<S443>/Switch' */
75real_T EthernetLinkStatus; /* '<S399>/dsa_tcpip_setup' */
76real_T CurrentAzimuth_rad; /* '<S397>/Switch' */
77real_T TargetAzimuth_rad; /* '<S397>/Switch1' */
78real_T TargetVelocity_kph; /* '<S397>/Switch3' */
79real_T Curvature; /* '<S397>/Switch4' */
80real_T CrosstrackError; /* '<S397>/Switch5' */
81real_T CurrentVelocity_kph; /* '<S397>/Switch2' */
82real_T GPS_X; /* '<S397>/Switch6' */
83real_T GPS_Y; /* '<S397>/Switch7' */
84real_T GPS_Time; /* '<S397>/Switch8' */
85real_T ReAX_EchoedSteerWheelPos; /* '<S443>/Switch' */
86real_T SteerWheelAngle; /* '<S645>/S-Function1' */
87real_T YawRate; /* '<S645>/S-Function1' */
88real_T SPN1810_LongitudinalAcceleration;/* '<S645>/S-Function1' */
89real_T WheelBasedVehicleSpeed; /* '<S506>/S-Function1' */
90real_T BrakeSwitch; /* '<S506>/S-Function1' */
91real_T Lateral_Control_Rate_Limit; /* '<S310>/Constant' */
92real_T Lateral_Control_Output; /* '<S281>/Sum1' */
93real_T Lateral_Control_Rate_Limiter_Output;/* '<S310>/If_Then_Else' */
94real_T SteerCommandDeg; /* '<S80>/sign flip' */
95real_T DesiredSteeringAngle; /* '<S80>/sign2' */
96real_T Lateral_Control_Heading_Error; /* '<S281>/Error Calc' */
97uint32_T DIAG_CAN1_Count_Stuff_Errors; /* '<S28>/S-Function1' */
98uint32_T DIAG_CAN1_Count_Format_Errors;/* '<S28>/S-Function1' */
99uint32_T DIAG_CAN1_Count_Ack_Errors; /* '<S28>/S-Function1' */
100uint32_T DIAG_CAN1_Count_Bit0_Errors; /* '<S28>/S-Function1' */
101uint32_T DIAG_CAN1_Count_Bit1_Errors; /* '<S28>/S-Function1' */
102uint32_T DIAG_CAN1_Count_CRC_Errors; /* '<S28>/S-Function1' */
103uint32_T DIAG_CAN1_Count_RX_Lost; /* '<S28>/S-Function1' */
104uint32_T DIAG_CAN1_Count_RX_OK; /* '<S28>/S-Function1' */
105uint32_T DIAG_CAN1_Count_TX_OK; /* '<S28>/S-Function1' */
106uint32_T DIAG_CAN5_Count_Stuff_Errors; /* '<S20>/S-Function1' */
107uint32_T DIAG_CAN5_Count_Format_Errors;/* '<S20>/S-Function1' */
108uint32_T DIAG_CAN5_Count_Ack_Errors; /* '<S20>/S-Function1' */
109uint32_T DIAG_CAN5_Count_Bit0_Errors; /* '<S20>/S-Function1' */
110uint32_T DIAG_CAN5_Count_Bit1_Errors; /* '<S20>/S-Function1' */
111uint32_T DIAG_CAN5_Count_CRC_Errors; /* '<S20>/S-Function1' */
112uint32_T DIAG_CAN5_Count_RX_Lost; /* '<S20>/S-Function1' */
113uint32_T DIAG_CAN5_Count_RX_OK; /* '<S20>/S-Function1' */
114uint32_T DIAG_CAN5_Count_TX_OK; /* '<S20>/S-Function1' */
115uint32_T DIAG_CAN6_Count_Stuff_Errors; /* '<S21>/S-Function1' */
116uint32_T DIAG_CAN6_Count_Format_Errors;/* '<S21>/S-Function1' */
117uint32_T DIAG_CAN6_Count_Ack_Errors; /* '<S21>/S-Function1' */
118uint32_T DIAG_CAN6_Count_Bit0_Errors; /* '<S21>/S-Function1' */
119uint32_T DIAG_CAN6_Count_Bit1_Errors; /* '<S21>/S-Function1' */
120uint32_T DIAG_CAN6_Count_CRC_Errors; /* '<S21>/S-Function1' */
121uint32_T DIAG_CAN6_Count_RX_Lost; /* '<S21>/S-Function1' */
122uint32_T DIAG_CAN6_Count_RX_OK; /* '<S21>/S-Function1' */
123uint32_T DIAG_CAN6_Count_TX_OK; /* '<S21>/S-Function1' */
124uint32_T DIAG_CAN3_Count_Stuff_Errors; /* '<S18>/S-Function1' */
125uint32_T DIAG_CAN3_Count_Format_Errors;/* '<S18>/S-Function1' */
126uint32_T DIAG_CAN3_Count_Ack_Errors; /* '<S18>/S-Function1' */
127uint32_T DIAG_CAN3_Count_Bit0_Errors; /* '<S18>/S-Function1' */
128uint32_T DIAG_CAN3_Count_Bit1_Errors; /* '<S18>/S-Function1' */
129uint32_T DIAG_CAN3_Count_CRC_Errors; /* '<S18>/S-Function1' */
130uint32_T DIAG_CAN3_Count_RX_Lost; /* '<S18>/S-Function1' */
131uint32_T DIAG_CAN3_Count_RX_OK; /* '<S18>/S-Function1' */
132uint32_T DIAG_CAN3_Count_TX_OK; /* '<S18>/S-Function1' */
133uint32_T DIAG_CAN4_Count_Stuff_Errors; /* '<S19>/S-Function1' */
134uint32_T DIAG_CAN4_Count_Format_Errors;/* '<S19>/S-Function1' */
135uint32_T DIAG_CAN4_Count_Ack_Errors; /* '<S19>/S-Function1' */
136uint32_T DIAG_CAN4_Count_Bit0_Errors; /* '<S19>/S-Function1' */
137uint32_T DIAG_CAN4_Count_Bit1_Errors; /* '<S19>/S-Function1' */
138uint32_T DIAG_CAN4_Count_CRC_Errors; /* '<S19>/S-Function1' */
139uint32_T DIAG_CAN4_Count_RX_Lost; /* '<S19>/S-Function1' */
140uint32_T DIAG_CAN4_Count_RX_OK; /* '<S19>/S-Function1' */
141uint32_T DIAG_CAN4_Count_TX_OK; /* '<S19>/S-Function1' */
142uint32_T DIAG_CAN2_Count_Stuff_Errors; /* '<S17>/S-Function1' */
143uint32_T DIAG_CAN2_Count_Format_Errors;/* '<S17>/S-Function1' */
144uint32_T DIAG_CAN2_Count_Ack_Errors; /* '<S17>/S-Function1' */
145uint32_T DIAG_CAN2_Count_Bit0_Errors; /* '<S17>/S-Function1' */
146uint32_T DIAG_CAN2_Count_Bit1_Errors; /* '<S17>/S-Function1' */
147uint32_T DIAG_CAN2_Count_CRC_Errors; /* '<S17>/S-Function1' */
148uint32_T DIAG_CAN2_Count_RX_Lost; /* '<S17>/S-Function1' */
149uint32_T DIAG_CAN2_Count_RX_OK; /* '<S17>/S-Function1' */
150uint32_T DIAG_CAN2_Count_TX_OK; /* '<S17>/S-Function1' */
151real32_T REAX_Handwheel_Torque; /* '<S419>/Data Type Conversion3' */
152real32_T REAX_Handwheel_Velocity; /* '<S419>/Data Type Conversion4' */
153real32_T REAX_Pull_Compensation; /* '<S419>/Data Type Conversion5' */
154ENUM_CAN_STATUS_DIAG_T DIAG_CAN1_Status;/* '<S1>/Data Type Conversion' */
155ENUM_CAN_STATUS_DIAG_T DIAG_CAN5_Status;/* '<S1>/Data Type Conversion5' */
156ENUM_CAN_STATUS_DIAG_T DIAG_CAN6_Status;/* '<S1>/Data Type Conversion4' */
157ENUM_CAN_STATUS_DIAG_T DIAG_CAN3_Status;/* '<S1>/Data Type Conversion3' */
158ENUM_CAN_STATUS_DIAG_T DIAG_CAN4_Status;/* '<S1>/Data Type Conversion2' */
159ENUM_CAN_STATUS_DIAG_T DIAG_CAN2_Status;/* '<S1>/Data Type Conversion1' */
160uint8_T SupervisorMode; /* '<S397>/Switch9' */
161uint8_T REAX_Current_Mode; /* '<S419>/Data Type Conversion' */
162uint8_T REAX_Req_Mode; /* '<S419>/Data Type Conversion1' */
163uint8_T REAX_Status; /* '<S419>/Data Type Conversion2' */
164uint8_T GLB_SWVERSION_CPV_[100]; /* '<S1090>/Constant' */
165uint8_T MABX_Mode; /* '<S76>/Switch' */
166boolean_T EStop; /* '<S416>/Logical Operator1' */
167boolean_T EnableSw; /* '<S745>/Switch' */
168boolean_T EngagePB; /* '<S743>/AND2' */
169boolean_T BrakeSW; /* '<S416>/Logical Operator3' */
170boolean_T MABX_Heartbeat; /* '<S398>/Cast To Boolean' */
171boolean_T Heartbeat_Ok; /* '<S403>/Switch1' */
172boolean_T RTMapsOk; /* '<S397>/AND' */
173boolean_T LogEventPB; /* '<S742>/AND2' */
174boolean_T AutonomousOutputEnabled; /* '<S76>/Autonomous Mode Switch' */
175boolean_T RateLimiterActive; /* '<S319>/Compare' */
176real_T Pedal_pwm_position; /* '<S765>/Switch' */
177
178/* Exported block parameters */
179real_T APTC_PEDAL_LOW_IDLE_SW_THR_APV = 3.0;/* Variable: APTC_PEDAL_LOW_IDLE_SW_THR_APV
180 * Referenced by: '<S75>/Constant'
181 */
182real_T APTC_TRQ_PED_INV_MAP_PED_POS_MPV[1328] = { 0.0, 0.3125, 0.859375, 1.15625,
183 1.59375, 1.8125, 1.921875, 2.375, 3.8125, 4.3125, 4.84375, 4.96875, 5.71875,
184 6.28125, 6.5625, 6.890625, 7.0, 7.8606557377049, 9.1229508196721,
185 10.327868852459, 11.532786885246, 14.0, 15.25748502994, 15.425149700599,
186 15.718562874251, 16.808383233533, 17.730538922156, 18.023952095808,
187 18.275449101796, 18.904191616766, 19.449101796407, 19.658682634731,
188 19.74251497006, 19.826347305389, 20.287425149701, 21.0, 21.516393442623,
189 22.290983606557, 23.409836065574, 24.758196721311, 24.959016393443,
190 25.217213114754, 26.22131147541, 26.995901639344, 27.311475409836,
191 27.454918032787, 27.512295081967, 27.684426229508, 28.0, 32.101910828025,
192 32.235668789809, 34.687898089172, 35.0, 36.734104046243, 38.815028901734,
193 42.28323699422, 42.514450867052, 44.364161849711, 51.878612716763, 55.0,
194 72.260273972603, 79.041095890411, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
195 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
196 100.0, 100.0, 100.0, 100.0, 0.0, 0.33333333333333, 0.91666666666667,
197 1.2333333333333, 1.7, 1.9333333333333, 2.05, 2.5333333333333, 4.0666666666667,
198 4.6, 5.1666666666667, 5.3, 6.1, 6.7, 7.0, 8.3738317757009, 8.8317757009346,
199 9.8130841121495, 11.252336448598, 12.626168224299, 14.0, 15.559585492228,
200 16.647668393782, 16.79274611399, 17.046632124352, 17.989637305699,
201 18.787564766839, 19.041450777202, 19.259067357513, 19.80310880829,
202 20.274611398964, 20.455958549223, 20.528497409326, 20.60103626943, 21.0,
203 21.476, 21.98, 22.736, 23.828, 25.144, 25.34, 25.592, 26.572, 27.328, 27.636,
204 27.776, 27.832, 28.0, 28.478260869565, 32.478260869565, 32.608695652174, 35.0,
205 35.777777777778, 37.444444444444, 39.444444444444, 42.777777777778, 43.0,
206 44.777777777778, 52.0, 55.0, 61.237623762376, 63.688118811881, 71.262376237624,
207 75.160891089109, 78.613861386139, 96.769801980198, 97.660891089109,
208 98.329207920792, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
209 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 0.57377049180328,
210 1.577868852459, 2.1229508196721, 2.9262295081967, 3.327868852459,
211 3.5286885245902, 4.3606557377049, 7.0, 7.8549618320611, 8.763358778626,
212 8.9770992366412, 10.259541984733, 11.221374045802, 11.702290076336,
213 12.263358778626, 12.450381679389, 12.851145038168, 13.43893129771, 14.0,
214 14.757731958763, 16.309278350515, 17.39175257732, 17.536082474227,
215 17.788659793814, 18.726804123711, 19.520618556701, 19.773195876289,
216 19.989690721649, 20.530927835052, 21.0, 21.132575757576, 21.185606060606,
217 21.238636363636, 21.530303030303, 21.981060606061, 22.458333333333,
218 23.174242424242, 24.208333333333, 25.454545454545, 25.640151515152,
219 25.878787878788, 26.806818181818, 27.522727272727, 27.814393939394,
220 27.94696969697, 28.0, 28.202898550725, 28.574879227053, 31.685990338164,
221 31.787439613527, 33.647342995169, 33.884057971014, 34.391304347826, 35.0,
222 36.704545454545, 36.818181818182, 37.727272727273, 41.420454545455,
223 42.954545454545, 46.136363636364, 47.386363636364, 51.25, 53.238636363636,
224 55.0, 64.249684741488, 64.703656998739, 65.044136191677, 65.895334174023,
225 75.769230769231, 79.457755359395, 82.919293820933, 84.451450189155,
226 93.417402269861, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
227 0.0, 0.92105263157895, 2.5328947368421, 3.4078947368421, 4.6973684210526,
228 5.3421052631579, 5.6644736842105, 7.0, 8.9339339339339, 9.6066066066066,
229 10.321321321321, 10.489489489489, 11.498498498498, 12.255255255255,
230 12.633633633634, 13.075075075075, 13.222222222222, 13.537537537538, 14.0,
231 14.65625, 15.3125, 16.65625, 17.59375, 17.71875, 17.9375, 18.75, 19.4375,
232 19.65625, 19.84375, 20.3125, 20.71875, 20.875, 20.9375, 21.0, 21.310483870968,
233 21.790322580645, 22.298387096774, 23.060483870968, 24.161290322581,
234 25.487903225806, 25.685483870968, 25.939516129032, 26.927419354839,
235 27.689516129032, 28.0, 28.143442622951, 28.200819672131, 28.372950819672,
236 28.688524590164, 31.327868852459, 31.41393442623, 32.991803278689,
237 33.19262295082, 33.622950819672, 34.139344262295, 35.0, 35.082474226804,
238 35.742268041237, 38.422680412371, 39.536082474227, 41.845360824742,
239 42.752577319588, 45.556701030928, 47.0, 48.278350515464, 55.0, 55.39603960396,
240 55.693069306931, 56.435643564356, 65.049504950495, 68.267326732673,
241 71.287128712871, 72.623762376238, 80.445544554455, 86.188118811881,
242 97.326732673267, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0,
243 1.2068965517241, 3.3189655172414, 4.4655172413793, 6.1551724137931, 7.0,
244 7.1412103746398, 7.7262247838617, 9.5821325648415, 10.227665706052,
245 10.913544668588, 11.07492795389, 12.043227665706, 12.769452449568,
246 13.132564841499, 13.556195965418, 13.697406340058, 14.0, 14.599221789883,
247 15.171206225681, 15.743190661479, 16.91439688716, 17.731517509728,
248 17.84046692607, 18.031128404669, 18.739299610895, 19.338521400778,
249 19.529182879377, 19.692607003891, 20.101167315175, 20.455252918288,
250 20.591439688716, 20.645914396887, 20.700389105058, 21.0, 21.526548672566,
251 22.08407079646, 22.920353982301, 24.128318584071, 25.58407079646,
252 25.800884955752, 26.079646017699, 27.163716814159, 28.0, 28.282051282051,
253 28.410256410256, 28.461538461538, 28.615384615385, 28.897435897436,
254 31.25641025641, 31.333333333333, 32.74358974359, 32.923076923077,
255 33.307692307692, 33.769230769231, 34.538461538462, 34.589743589744, 35.0,
256 36.768707482993, 37.503401360544, 39.027210884354, 39.625850340136,
257 41.47619047619, 42.428571428571, 43.272108843537, 47.707482993197,
258 47.925170068027, 48.08843537415, 48.496598639456, 53.231292517007, 55.0,
259 57.99672489083, 59.323144104803, 67.085152838428, 72.78384279476,
260 83.837336244541, 86.490174672489, 91.550218340611, 99.312227074236, 100.0,
261 100.0, 100.0, 100.0, 0.0, 1.8918918918919, 5.2027027027027, 7.0,
262 7.5340599455041, 7.8010899182561, 7.9346049046322, 8.4877384196185,
263 10.242506811989, 10.852861035422, 11.50136239782, 11.653950953678,
264 12.569482288828, 13.256130790191, 13.599455040872, 14.0, 14.185606060606,
265 14.583333333333, 15.166666666667, 15.723484848485, 16.280303030303,
266 17.420454545455, 18.215909090909, 18.32196969697, 18.507575757576,
267 19.19696969697, 19.780303030303, 19.965909090909, 20.125, 20.522727272727,
268 20.867424242424, 21.0, 21.065420560748, 21.130841121495, 21.490654205607,
269 22.046728971963, 22.635514018692, 23.518691588785, 24.794392523364,
270 26.331775700935, 26.560747663551, 26.855140186916, 28.0, 28.665492957746,
271 28.93661971831, 29.05985915493, 29.109154929577, 29.257042253521,
272 29.528169014085, 31.795774647887, 31.869718309859, 33.225352112676,
273 33.397887323944, 33.767605633803, 34.211267605634, 34.950704225352, 35.0,
274 35.381406436234, 36.930870083433, 37.574493444577, 38.909415971395,
275 39.433849821216, 41.054827175209, 41.88915375447, 42.628128724672,
276 46.513706793802, 46.704410011919, 46.847437425507, 47.205005959476,
277 51.352800953516, 52.902264600715, 54.356376638856, 55.0, 62.917594654788,
278 68.730512249443, 80.005567928731, 82.711581291759, 87.873051224944,
279 95.790645879733, 96.492204899777, 100.0, 100.0, 100.0, 0.0, 7.0,
280 7.8448275862069, 8.3034482758621, 8.9793103448276, 9.3172413793103,
281 9.4862068965517, 10.186206896552, 12.406896551724, 13.179310344828, 14.0,
282 14.157303370787, 15.101123595506, 15.808988764045, 16.162921348315,
283 16.575842696629, 16.713483146067, 17.008426966292, 17.441011235955,
284 17.85393258427, 18.266853932584, 19.112359550562, 19.702247191011,
285 19.780898876404, 19.918539325843, 20.429775280899, 20.862359550562, 21.0,
286 21.192660550459, 21.674311926606, 22.091743119266, 22.252293577982,
287 22.316513761468, 22.380733944954, 22.733944954128, 23.279816513761,
288 23.857798165138, 24.724770642202, 25.977064220183, 27.48623853211,
289 27.711009174312, 28.0, 28.910780669145, 29.613382899628, 29.899628252788,
290 30.029739776952, 30.081784386617, 30.237918215613, 30.524163568773,
291 32.918215613383, 32.996282527881, 34.42750929368, 34.609665427509, 35.0,
292 35.417633410673, 36.113689095128, 36.160092807425, 36.5313225058,
293 38.039443155452, 38.665893271462, 39.965197215777, 40.475638051044,
294 42.053364269142, 42.865429234339, 43.584686774942, 47.366589327146,
295 47.552204176334, 47.691415313225, 48.039443155452, 52.07656612529,
296 53.584686774942, 55.0, 56.296691568837, 63.884738527215, 69.455709711846,
297 80.261472785486, 82.854855923159, 87.801494130203, 95.389541088581,
298 96.061899679829, 99.423692636073, 100.0, 100.0, 0.0, 7.0, 9.378640776699,
299 10.669902912621, 12.572815533981, 13.52427184466, 14.0, 14.394941634241,
300 15.647859922179, 16.083657587549, 16.546692607004, 16.655642023346,
301 17.309338521401, 17.799610894942, 18.044747081712, 18.330739299611,
302 18.426070038911, 18.630350194553, 18.929961089494, 19.215953307393,
303 19.501945525292, 20.087548638132, 20.496108949416, 20.550583657588,
304 20.645914396887, 21.0, 21.836956521739, 22.103260869565, 22.33152173913,
305 22.902173913043, 23.396739130435, 23.586956521739, 23.663043478261,
306 23.739130434783, 24.157608695652, 24.804347826087, 25.489130434783,
307 26.516304347826, 28.0, 29.305555555556, 29.5, 29.75, 30.722222222222,
308 31.472222222222, 31.777777777778, 31.916666666667, 31.972222222222,
309 32.138888888889, 32.444444444444, 35.0, 35.073529411765, 36.421568627451,
310 36.593137254902, 36.960784313725, 37.401960784314, 38.137254901961,
311 38.186274509804, 38.578431372549, 40.171568627451, 40.833333333333,
312 42.205882352941, 42.745098039216, 44.411764705882, 45.269607843137,
313 46.029411764706, 50.024509803922, 50.220588235294, 50.367647058824,
314 50.735294117647, 55.0, 57.720930232558, 60.274418604651, 61.404651162791,
315 68.018604651163, 72.874418604651, 82.293023255814, 84.553488372093,
316 88.86511627907, 95.479069767442, 96.06511627907, 98.995348837209,
317 99.497674418605, 100.0, 0.0, 14.0, 14.419520547945, 14.647260273973,
318 14.982876712329, 15.150684931507, 15.234589041096, 15.582191780822,
319 16.684931506849, 17.068493150685, 17.47602739726, 17.571917808219,
320 18.147260273973, 18.578767123288, 18.794520547945, 19.046232876712,
321 19.130136986301, 19.309931506849, 19.573630136986, 19.825342465753,
322 20.077054794521, 20.592465753425, 20.952054794521, 21.0, 21.324503311258,
323 22.529801324503, 23.549668874172, 23.87417218543, 24.152317880795,
324 24.847682119205, 25.450331125828, 25.682119205298, 25.774834437086,
325 25.867549668874, 26.377483443709, 27.165562913907, 28.0, 28.913043478261,
326 30.231884057971, 31.821256038647, 32.057971014493, 32.36231884058,
327 33.545893719807, 34.458937198068, 34.830917874396, 35.0, 35.054200542005,
328 35.216802168022, 35.514905149051, 38.008130081301, 38.089430894309,
329 39.579945799458, 39.769647696477, 40.176151761518, 40.663956639566,
330 41.476964769648, 41.531165311653, 41.964769647696, 43.726287262873,
331 44.457994579946, 45.975609756098, 46.571815718157, 48.414634146341,
332 49.363143631436, 50.20325203252, 54.620596205962, 54.837398373984, 55.0,
333 55.583910034602, 62.357266435986, 64.887543252595, 67.262110726644,
334 68.313148788927, 74.463667820069, 78.979238754325, 87.737889273356,
335 89.839965397924, 93.849480968858, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 14.0,
336 14.708092485549, 15.092485549133, 15.658959537572, 15.942196531792,
337 16.083815028902, 16.670520231214, 18.531791907514, 19.179190751445,
338 19.867052023121, 20.028901734104, 21.0, 21.739002932551, 22.108504398827,
339 22.539589442815, 22.683284457478, 22.991202346041, 23.442815249267,
340 23.873900293255, 24.304985337243, 25.187683284457, 25.803519061584,
341 25.885630498534, 26.029325513196, 26.563049853372, 27.014662756598,
342 27.158357771261, 27.281524926686, 27.589442815249, 27.856304985337,
343 27.958944281525, 28.0, 28.083333333333, 28.541666666667, 29.25, 30.0, 31.125,
344 32.75, 34.708333333333, 35.0, 35.291734197731, 36.426256077796,
345 37.301458670989, 37.658022690438, 37.820097244733, 37.884927066451,
346 38.079416531605, 38.435980551053, 41.418152350081, 41.515397082658,
347 43.298217179903, 43.525121555916, 44.011345218801, 44.594813614263,
348 45.567260940032, 45.63209076175, 46.150729335494, 48.257698541329,
349 49.132901134522, 50.948136142626, 51.661264181523, 53.865478119935, 55.0,
350 56.15671641791, 62.238805970149, 62.537313432836, 62.761194029851,
351 63.320895522388, 69.813432835821, 72.238805970149, 74.514925373134,
352 75.522388059701, 81.417910447761, 85.746268656716, 94.141791044776,
353 96.15671641791, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 14.0,
354 16.987804878049, 18.609756097561, 21.0, 21.175942549372, 21.263913824057,
355 21.628366247756, 22.784560143627, 23.18671454219, 23.614003590664,
356 23.714542190305, 24.317773788151, 24.770197486535, 24.996409335727,
357 25.260323159785, 25.34829443447, 25.536804308797, 25.81328545781,
358 26.077199281867, 26.341113105925, 26.881508078995, 27.258527827648,
359 27.308797127469, 27.396768402154, 27.723518850987, 28.0, 28.39837398374,
360 28.739837398374, 29.593495934959, 30.333333333333, 30.617886178862,
361 30.731707317073, 30.845528455285, 31.471544715447, 32.439024390244,
362 33.463414634146, 35.0, 36.553784860558, 38.426294820717, 38.705179282869,
363 39.06374501992, 40.458167330677, 41.533864541833, 41.972111553785,
364 42.171314741036, 42.250996015936, 42.490039840637, 42.92828685259,
365 46.593625498008, 46.713147410359, 48.90438247012, 49.183266932271,
366 49.780876494024, 50.498007968127, 51.693227091633, 51.772908366534,
367 52.410358565737, 55.0, 55.966587112172, 57.971360381862, 58.758949880668,
368 61.193317422434, 62.44630071599, 63.556085918854, 69.391408114558,
369 69.677804295943, 69.892601431981, 70.429594272076, 76.658711217184,
370 78.985680190931, 81.169451073986, 82.136038186158, 87.792362768496,
371 91.945107398568, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0,
372 21.0, 21.414551607445, 21.639593908629, 21.971235194585, 22.137055837563,
373 22.219966159052, 22.56345177665, 23.653130287648, 24.032148900169,
374 24.434856175973, 24.529610829103, 25.098138747885, 25.524534686971,
375 25.737732656514, 25.986463620981, 26.06937394247, 26.24703891709,
376 26.507614213198, 26.756345177665, 27.005076142132, 27.514382402707,
377 27.869712351946, 27.917089678511, 28.0, 30.394736842105, 32.421052631579,
378 33.065789473684, 33.618421052632, 35.0, 35.668380462725, 35.925449871465,
379 36.028277634961, 36.131105398458, 36.696658097686, 37.570694087404,
380 38.496143958869, 39.884318766067, 41.889460154242, 44.305912596401,
381 44.665809768638, 45.12853470437, 46.928020565553, 48.316195372751,
382 48.881748071979, 49.13881748072, 49.241645244216, 49.550128534704,
383 50.115681233933, 54.845758354756, 55.0, 57.201957295374, 57.482206405694,
384 58.082740213523, 58.803380782918, 60.004448398577, 60.084519572954,
385 60.725088967972, 63.327402135231, 64.408362989324, 66.650355871886,
386 67.531138790036, 70.253558718861, 71.654804270463, 72.89590747331,
387 79.421708185053, 79.741992882562, 79.982206405694, 80.582740213523,
388 87.548932384342, 90.151245551601, 92.593416370107, 93.674377224199, 100.0,
389 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 21.0,
390 21.822147651007, 22.268456375839, 22.926174496644, 23.255033557047,
391 23.419463087248, 24.10067114094, 26.261744966443, 27.013422818792,
392 27.812080536913, 28.0, 29.191489361702, 30.085106382979, 30.531914893617,
393 31.053191489362, 31.22695035461, 31.599290780142, 32.145390070922,
394 32.666666666667, 33.187943262411, 34.255319148936, 35.0, 35.298507462687,
395 35.820895522388, 37.761194029851, 39.402985074627, 39.925373134328,
396 40.373134328358, 41.492537313433, 42.462686567164, 42.835820895522,
397 42.985074626866, 43.134328358209, 43.955223880597, 45.223880597015,
398 46.567164179104, 48.582089552239, 51.492537313433, 55.0, 55.381355932203,
399 55.871670702179, 57.778450363196, 59.249394673123, 59.848668280872,
400 60.121065375303, 60.230024213075, 60.556900726392, 61.15617433414,
401 66.168280871671, 66.331719128329, 69.32808716707, 69.709443099274,
402 70.526634382567, 71.507263922518, 73.141646489104, 73.250605326877,
403 74.122276029056, 77.663438256659, 79.134382566586, 82.185230024213,
404 83.383777239709, 87.088377723971, 88.995157384988, 90.68401937046,
405 99.56416464891, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
406 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0, 21.0, 28.0,
407 28.383285302594, 28.948126801153, 29.230547550432, 29.371757925072,
408 29.956772334294, 31.812680115274, 32.458213256484, 33.14409221902,
409 33.305475504323, 34.273775216138, 35.0, 36.333333333333, 37.888888888889,
410 38.407407407407, 39.518518518519, 41.148148148148, 42.703703703704,
411 44.259259259259, 47.444444444444, 49.666666666667, 49.962962962963,
412 50.481481481481, 52.407407407407, 54.037037037037, 54.555555555556, 55.0,
413 55.941422594142, 56.757322175732, 57.071129707113, 57.196652719665,
414 57.322175732218, 58.012552301255, 59.07949790795, 60.20920502092,
415 61.903765690377, 64.351464435146, 67.301255230126, 67.740585774059,
416 68.305439330544, 70.502092050209, 72.196652719665, 72.887029288703,
417 73.200836820084, 73.326359832636, 73.702928870293, 74.393305439331,
418 80.167364016736, 80.355648535565, 83.807531380753, 84.246861924686,
419 85.188284518828, 86.317991631799, 88.200836820084, 88.326359832636,
420 89.330543933054, 93.410041841004, 95.10460251046, 98.619246861925, 100.0,
421 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
422 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 0.0,
423 28.0, 28.95703125, 29.4765625, 30.2421875, 30.625, 30.81640625, 31.609375,
424 34.125, 35.0, 37.098765432099, 37.592592592593, 40.555555555556,
425 42.777777777778, 43.888888888889, 45.185185185185, 45.617283950617,
426 46.543209876543, 47.901234567901, 49.197530864198, 50.493827160494,
427 53.148148148148, 55.0, 55.234680573664, 55.645371577575, 57.170795306389,
428 58.461538461538, 58.87222946545, 59.224250325945, 60.104302477184,
429 60.867014341591, 61.16036505867, 61.277705345502, 61.395045632334,
430 62.040417209909, 63.037809647979, 64.093872229465, 65.677966101695,
431 67.966101694915, 70.723598435463, 71.134289439374, 71.662320730117,
432 73.715775749674, 75.299869621904, 75.945241199478, 76.238591916558,
433 76.35593220339, 76.707953063885, 77.35332464146, 82.750977835724,
434 82.926988265971, 86.153846153846, 86.564537157757, 87.444589308996,
435 88.500651890482, 90.26075619296, 90.378096479791, 91.316818774446,
436 95.13037809648, 96.714471968709, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
437 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
438 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
439 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
440 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
441 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
442 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
443 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
444 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
445 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0,
446 100.0 } ; /* Variable: APTC_TRQ_PED_INV_MAP_PED_POS_MPV
447 * Referenced by: '<S85>/2D_Lookup_Table'
448 */
449
450real_T APTC_TRQ_PED_INV_MAP_TRQ_STEPS[83] = { 0.0, 20.0, 55.0, 74.0, 102.0,
451 116.0, 123.0, 152.0, 244.0, 276.0, 310.0, 318.0, 366.0, 402.0, 420.0, 441.0,
452 448.0, 463.0, 485.0, 506.0, 527.0, 570.0, 600.0, 604.0, 611.0, 637.0, 659.0,
453 666.0, 672.0, 687.0, 700.0, 705.0, 707.0, 709.0, 720.0, 737.0, 755.0, 782.0,
454 821.0, 868.0, 875.0, 884.0, 919.0, 946.0, 957.0, 962.0, 964.0, 970.0, 981.0,
455 1073.0, 1076.0, 1131.0, 1138.0, 1153.0, 1171.0, 1201.0, 1203.0, 1219.0, 1284.0,
456 1311.0, 1367.0, 1389.0, 1457.0, 1492.0, 1523.0, 1686.0, 1694.0, 1700.0, 1715.0,
457 1889.0, 1954.0, 2015.0, 2042.0, 2200.0, 2316.0, 2541.0, 2595.0, 2698.0, 2856.0,
458 2870.0, 2940.0, 2952.0, 2964.0 } ; /* Variable: APTC_TRQ_PED_INV_MAP_TRQ_STEPS
459 * Referenced by: '<S85>/2D_Lookup_Table'
460 */
461
462real_T APTC_TRQ_PED_TRQ_DATA_MPV[128] = { 0.0, 448.0, 570.0, 737.0, 981.0,
463 1138.0, 1311.0, 1457.0, 0.0, 420.0, 527.0, 720.0, 970.0, 1131.0, 1311.0,
464 1715.0, 0.0, 244.0, 506.0, 700.0, 964.0, 1171.0, 1523.0, 2316.0, 0.0, 152.0,
465 485.0, 709.0, 957.0, 1201.0, 1686.0, 2595.0, 0.0, 116.0, 463.0, 720.0, 946.0,
466 1219.0, 1954.0, 2870.0, 0.0, 74.0, 441.0, 705.0, 919.0, 1203.0, 2042.0, 2940.0,
467 0.0, 20.0, 310.0, 666.0, 884.0, 1153.0, 2015.0, 2952.0, 0.0, 20.0, 123.0,
468 637.0, 821.0, 1073.0, 1889.0, 2964.0, 0.0, 20.0, 20.0, 604.0, 755.0, 962.0,
469 1700.0, 2856.0, 0.0, 20.0, 20.0, 366.0, 707.0, 875.0, 1492.0, 2698.0, 0.0,
470 20.0, 20.0, 102.0, 659.0, 782.0, 1284.0, 2541.0, 0.0, 20.0, 20.0, 20.0, 611.0,
471 687.0, 1076.0, 2200.0, 0.0, 20.0, 20.0, 20.0, 318.0, 600.0, 868.0, 1694.0, 0.0,
472 20.0, 20.0, 20.0, 55.0, 402.0, 672.0, 1389.0, 0.0, 20.0, 20.0, 20.0, 20.0,
473 276.0, 600.0, 1367.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ;/* Variable: APTC_TRQ_PED_TRQ_DATA_MPV
474 * Referenced by: '<S83>/2-D Lookup Table'
475 */
476
477real_T APTC_TRQ_PED_TRQ_ESPD_STEP_MPV[16] = { 500.0, 650.0, 885.0, 950.0, 1050.0,
478 1120.0, 1240.0, 1360.0, 1475.0, 1590.0, 1710.0, 1830.0, 1950.0, 2150.0, 2300.0,
479 2350.0 } ; /* Variable: APTC_TRQ_PED_TRQ_ESPD_STEP_MPV
480 * Referenced by:
481 * '<S83>/2-D Lookup Table'
482 * '<S85>/2D_Lookup_Table'
483 */
484
485real_T APTC_TRQ_PED_TRQ_POS_STEP_MPV[8] = { 0.0, 7.0, 14.0, 21.0, 28.0, 35.0,
486 55.0, 100.0 } ; /* Variable: APTC_TRQ_PED_TRQ_POS_STEP_MPV
487 * Referenced by: '<S83>/2-D Lookup Table'
488 */
489
490real_T BRK_DEM_KD_DATA_MPV[8] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ;/* Variable: BRK_DEM_KD_DATA_MPV
491 * Referenced by: '<S149>/1D_Lookup_Table'
492 */
493
494real_T BRK_DEM_KI_DATA_MPV[8] = { -1.5, -1.5, -1.5, -1.5, -1.5, -1.5, -1.5, -1.5
495} ; /* Variable: BRK_DEM_KI_DATA_MPV
496 * Referenced by: '<S148>/1D_Lookup_Table'
497 */
498
499real_T BRK_DEM_KP_DATA_MPV[8] = { -4.0, -4.0, -4.0, -4.0, -4.0, -4.0, -4.0, -4.0
500} ; /* Variable: BRK_DEM_KP_DATA_MPV
501 * Referenced by: '<S147>/1D_Lookup_Table'
502 */
503
504real_T BRK_DEM_MASS_STEP_MPV[8] = { 0.0, 5000.0, 10000.0, 20000.0, 30000.0,
505 40000.0, 50000.0, 54000.0 } ; /* Variable: BRK_DEM_MASS_STEP_MPV
506 * Referenced by:
507 * '<S147>/1D_Lookup_Table'
508 * '<S148>/1D_Lookup_Table'
509 * '<S149>/1D_Lookup_Table'
510 */
511
512real_T BRK_GOV_FF_DECEL_RATE_DATA_MPV[32] = { 0.0, -0.39, -1.76, -3.13, -4.5,
513 -5.87, -7.24, -8.61, -9.98, -11.35, -12.72, -14.09, -15.46, -16.83, -18.2,
514 -19.57, 0.0, -0.12, -0.53, -0.94, -1.35, -1.76, -2.17, -2.58, -2.99, -3.41,
515 -3.82, -4.23, -4.64, -5.05, -5.46, -5.87 } ;/* Variable: BRK_GOV_FF_DECEL_RATE_DATA_MPV
516 * Referenced by: '<S199>/2D_Lookup_Table'
517 */
518
519real_T BRK_GOV_FF_DECEL_RATE_STEP_MPV[16] = { -19.57, -18.2, -16.83, -15.46,
520 -14.09, -12.72, -11.35, -9.98, -8.61, -7.24, -5.87, -4.5, -3.13, -1.76, -0.39,
521 0.0 } ; /* Variable: BRK_GOV_FF_DECEL_RATE_STEP_MPV
522 * Referenced by:
523 * '<S200>/2D_Lookup_Table'
524 * '<S201>/2D_Lookup_Table'
525 */
526
527real_T BRK_GOV_FF_MASS_STEP_MPV[2] = { 9035.0, 36287.0 } ;/* Variable: BRK_GOV_FF_MASS_STEP_MPV
528 * Referenced by:
529 * '<S199>/2D_Lookup_Table'
530 * '<S200>/2D_Lookup_Table'
531 * '<S201>/2D_Lookup_Table'
532 */
533
534real_T BRK_GOV_FF_PRESS_KPA_DATA_MPV[32] = { 1034.0, 965.0, 896.0, 827.0, 758.0,
535 689.0, 621.0, 552.0, 483.0, 414.0, 345.0, 276.0, 207.0, 138.0, 69.0, 0.0,
536 2585.0, 2413.0, 2240.0, 2068.0, 1895.0, 1723.0, 1553.0, 1380.0, 1208.0, 1035.0,
537 863.0, 690.0, 518.0, 345.0, 173.0, 0.0 } ;/* Variable: BRK_GOV_FF_PRESS_KPA_DATA_MPV
538 * Referenced by:
539 * '<S200>/2D_Lookup_Table'
540 * '<S201>/2D_Lookup_Table'
541 */
542
543real_T BRK_GOV_FF_PRESS_KPA_STEP_MPV[16] = { 0.0, 69.0, 138.0, 207.0, 276.0,
544 345.0, 414.0, 483.0, 552.0, 621.0, 689.0, 758.0, 827.0, 896.0, 965.0, 1034.0 }
545; /* Variable: BRK_GOV_FF_PRESS_KPA_STEP_MPV
546 * Referenced by: '<S199>/2D_Lookup_Table'
547 */
548
549real_T Curvature_FF_Gain = 5.7; /* Variable: Curvature_FF_Gain
550 * Referenced by: '<S281>/FeedforwardGain'
551 */
552real_T DISTANCE_M = 200.0; /* Variable: DISTANCE_M
553 * Referenced by: '<S81>/DISTANCE_M'
554 */
555real_T Lateral_Control_Curvature_Limit = 0.5;/* Variable: Lateral_Control_Curvature_Limit
556 * Referenced by:
557 * '<S281>/Constant3'
558 * '<S281>/Constant5'
559 */
560real_T Lateral_Control_D = 0.1; /* Variable: Lateral_Control_D
561 * Referenced by: '<S307>/Derivative Gain'
562 */
563real_T Lateral_Control_Error_Limit = 0.1;/* Variable: Lateral_Control_Error_Limit
564 * Referenced by:
565 * '<S281>/Constant'
566 * '<S281>/Constant1'
567 */
568real_T Lateral_Control_Error_Rate_Limit = 0.05;/* Variable: Lateral_Control_Error_Rate_Limit
569 * Referenced by:
570 * '<S281>/Constant10'
571 * '<S281>/Constant7'
572 * '<S281>/Constant8'
573 * '<S281>/Constant9'
574 */
575real_T Lateral_Control_I = 0.0; /* Variable: Lateral_Control_I
576 * Referenced by: '<S307>/Integral Gain'
577 */
578real_T Lateral_Control_P = 0.5; /* Variable: Lateral_Control_P
579 * Referenced by:
580 * '<S281>/PGain'
581 * '<S307>/Proportional Gain'
582 */
583real_T Lateral_Control_Pole = 0.98; /* Variable: Lateral_Control_Pole
584 * Referenced by: '<S311>/GainPole'
585 */
586real_T Lateral_Control_Rate_Limit_APV = 0.05;/* Variable: Lateral_Control_Rate_Limit_APV
587 * Referenced by: '<S310>/Constant'
588 */
589real_T Lateral_Control_YawRate_Limit = 1.0;/* Variable: Lateral_Control_YawRate_Limit
590 * Referenced by:
591 * '<S281>/Constant2'
592 * '<S281>/Constant4'
593 */
594real_T Lateral_Control_Zero = 0.99; /* Variable: Lateral_Control_Zero
595 * Referenced by: '<S311>/GainZero'
596 */
597real_T PROPB_REAX_1_E4_DESIRED_POSITION_APV = 0.0;/* Variable: PROPB_REAX_1_E4_DESIRED_POSITION_APV
598 * Referenced by: '<S994>/Constant7'
599 */
600real_T REAX_OFFSET_APV = 0.0; /* Variable: REAX_OFFSET_APV
601 * Referenced by:
602 * '<S80>/Constant'
603 * '<S280>/ReAX Offset'
604 * '<S281>/Constant6'
605 */
606real_T STANLEY_GAIN_APV = 0.05; /* Variable: STANLEY_GAIN_APV
607 * Referenced by: '<S280>/StanleySteeringControlGain'
608 */
609real_T STEERCTRL_WHEEL_ANGLE_DATA_MPV[72] = { -800.02001953125, -780.02899169922,
610 -760.03399658203, -740.0, -720.0, -700.00402832031, -680.0, -660.01397705078,
611 -640.01898193359, -620.02398681641, -600.02001953125, -580.03399658203,
612 -560.03900146484, -540.0, -520.00402832031, -500.00900268555, -480.01400756836,
613 -460.01901245117, -440.02398681641, -420.01998901367, -400.03399658203,
614 -380.03900146484, -360.0, -340.00399780273, -320.00900268555, -300.01400756836,
615 -280.01901245117, -260.02398681641, -240.02900695801, -220.03399658203,
616 -200.03900146484, -180.0, -160.00399780273, -140.00900268555, -120.01399993896,
617 -100.01899719238, -80.024002075195, -60.028999328613, -40.034000396729,
618 0.52700001001358, 29.969999313354, 50.00899887085, 69.959999084473,
619 89.949996948242, 109.99500274658, 129.99000549316, 149.98500061035,
620 170.0240020752, 189.97500610352, 209.9700012207, 229.96499633789,
621 249.96000671387, 270.0, 289.99499511719, 309.98999023438, 329.98498535156,
622 349.98001098633, 369.97500610352, 390.01400756836, 410.00900268555, 450.0,
623 470.0299987793, 489.98999023438, 509.98498535156, 529.97998046875,
624 549.97497558594, 569.96997070313, 589.96502685547, 610.21997070313, 630.0,
625 650.25, 670.0 } ; /* Variable: STEERCTRL_WHEEL_ANGLE_DATA_MPV
626 * Referenced by: '<S276>/1D_Lookup_Table'
627 */
628
629real_T STEERCTRL_WHEEL_ANGLE_STEP_MPV[72] = { -46.0, -44.5, -43.0, -42.0, -40.0,
630 -39.0, -37.5, -36.5, -35.0, -34.0, -33.0, -31.5, -30.5, -29.0, -28.0, -26.5,
631 -25.5, -24.5, -23.5, -22.0, -21.0, -20.0, -19.0, -17.5, -16.5, -15.5, -14.0,
632 -13.0, -12.0, -11.0, -10.0, -8.5, -7.5, -6.5, -5.0, -4.0, -3.0, -2.0, -1.0,
633 0.0, 1.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0,
634 15.0, 16.0, 17.0, 18.5, 19.5, 20.5, 21.5, 23.5, 24.5, 25.5, 26.5, 27.5, 28.5,
635 29.0, 30.0, 31.0, 31.5, 32.5, 33.0 } ;/* Variable: STEERCTRL_WHEEL_ANGLE_STEP_MPV
636 * Referenced by: '<S276>/1D_Lookup_Table'
637 */
638
639real_T TQ_DEM_GEAR_RATIO_STEP_MPV[8] = { 0.0, 0.2, 4.0, 8.0, 10.0, 16.0, 18.0,
640 20.0 } ; /* Variable: TQ_DEM_GEAR_RATIO_STEP_MPV
641 * Referenced by:
642 * '<S241>/2D_Lookup_Table'
643 * '<S242>/2D_Lookup_Table'
644 * '<S243>/2D_Lookup_Table'
645 */
646
647real_T TQ_DEM_KD_DATA_MPV[64] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
648 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
649 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
650 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
651 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 } ;/* Variable: TQ_DEM_KD_DATA_MPV
652 * Referenced by: '<S243>/2D_Lookup_Table'
653 */
654
655real_T TQ_DEM_KI_DATA_MPV[64] = { 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7,
656 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7,
657 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7,
658 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7,
659 0.7, 0.7, 0.7, 0.7, 0.7, 0.7, 0.7 } ;/* Variable: TQ_DEM_KI_DATA_MPV
660 * Referenced by: '<S242>/2D_Lookup_Table'
661 */
662
663real_T TQ_DEM_KP_DATA_MPV[64] = { 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0,
664 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0,
665 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0,
666 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0,
667 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0 } ;/* Variable: TQ_DEM_KP_DATA_MPV
668 * Referenced by: '<S241>/2D_Lookup_Table'
669 */
670
671real_T TQ_DEM_MASS_STEP_MPV[8] = { 0.0, 5000.0, 10000.0, 20000.0, 30000.0,
672 40000.0, 50000.0, 54000.0 } ; /* Variable: TQ_DEM_MASS_STEP_MPV
673 * Referenced by:
674 * '<S241>/2D_Lookup_Table'
675 * '<S242>/2D_Lookup_Table'
676 * '<S243>/2D_Lookup_Table'
677 */
678
679real_T UndersteerCorection = 0.5; /* Variable: UndersteerCorection
680 * Referenced by: '<S281>/UndersteerCorrection'
681 */
682real_T VSPD_TARGET_KPH_APV = 0.0; /* Variable: VSPD_TARGET_KPH_APV
683 * Referenced by: '<S81>/VSPD_TARGET_KPH_APV'
684 */
685real_T YAW_RATE_OFFSET_APV = -0.0066; /* Variable: YAW_RATE_OFFSET_APV
686 * Referenced by: '<S281>/YAW_RATE_OFFSET_APV'
687 */
688real_T Yaw_Rate_FF_Gain = 0.1; /* Variable: Yaw_Rate_FF_Gain
689 * Referenced by: '<S281>/RateFeedbackGain'
690 */
691ENUM_AUTONOMOUS_MODE_T AUTONOMOUS_MODE_SELECTOR_APV =
692 ENUM_AUTONOMOUS_MODE_T_AUTO; /* Variable: AUTONOMOUS_MODE_SELECTOR_APV
693 * Referenced by: '<S76>/AUTONOMOUS_MODE_SELECTOR_APV'
694 */
695ENUM_CAN_RX_T CANR_PROPB_XPR_1_50_CHANNEL_APV = ENUM_CAN_RX_T_RX_CAN_3;/* Variable: CANR_PROPB_XPR_1_50_CHANNEL_APV
696 * Referenced by: '<S446>/Constant'
697 */
698ENUM_CAN_RX_T PROPB_REAX_CHANNEL_APV = ENUM_CAN_RX_T_RX_CAN_2;/* Variable: PROPB_REAX_CHANNEL_APV
699 * Referenced by:
700 * '<S444>/Constant'
701 * '<S445>/Constant'
702 * '<S466>/Constant3'
703 */
704ENUM_LAT_STEER_SOURCE_T LAT_STEER_SRC_SELECTOR_APV =
705 ENUM_LAT_STEER_SOURCE_T_PIC_HARIS; /* Variable: LAT_STEER_SRC_SELECTOR_APV
706 * Referenced by: '<S80>/LAT_STEER_SRC_SELECTOR_APV'
707 */
708ENUM_LONG_SPEED_DEMAND_SOURCE_T LONG_SPEED_SRC_SELECTOR_APV =
709 ENUM_LONG_SPEED_DEMAND_SOURCE_T_WAYPOINTS;/* Variable: LONG_SPEED_SRC_SELECTOR_APV
710 * Referenced by:
711 * '<S80>/LONG_SPEED_SRC_SELECTOR_APV'
712 * '<S81>/LONG_SPEED_SRC_SELECTOR_APV'
713 */
714ENUM_REAX_OPERATION_MODE_T PROPB_REAX_1_E4_DESIRED_OPMODE_APV =
715 ENUM_REAX_OPERATION_MODE_T_POSITION_CTRL_MODE;/* Variable: PROPB_REAX_1_E4_DESIRED_OPMODE_APV
716 * Referenced by: '<S977>/Constant6'
717 */
718ENUM_STEERING_POS_SIGNAL_SOURCE_T PROPB_REAX_1_E4_DES_POS_SIG_SRC_APV =
719 ENUM_STEERING_POS_SIGNAL_SOURCE_T_ESTIMATION;/* Variable: PROPB_REAX_1_E4_DES_POS_SIG_SRC_APV
720 * Referenced by: '<S994>/Constant1'
721 */
722ENUM_SWITCH_T RATE_LIMITER_ENABLE_APV = ENUM_SWITCH_T_ON;/* Variable: RATE_LIMITER_ENABLE_APV
723 * Referenced by: '<S310>/RATE_LIMITER_ENABLE_APV'
724 */
725
726/* Block signals (default storage) */
727B_L4_MABX_T L4_MABX_B;
728
729/* Block states (default storage) */
730DW_L4_MABX_T L4_MABX_DW;
731
732/* Previous zero-crossings (trigger) states */
733PrevZCX_L4_MABX_T L4_MABX_PrevZCX;
734
735/* Real-time model */
736RT_MODEL_L4_MABX_T L4_MABX_M_;
737RT_MODEL_L4_MABX_T *const L4_MABX_M = &L4_MABX_M_;
738
739/* Forward declaration for local functions */
740static int32_T safe_cast_to_ENUM_XPR_CONTROL_M(int32_T input);
741static int32_T safe_cast_to_ENUM_XPR_ERROR_STA(int32_T input);
742static void L4_MABX_enter_atomic_INITIAL(void);
743static void L4_MABX_Calculate_abc(void);
744static void L4_MABX_CalculateAlternate_abc(void);
745static void L4_MABX_CalculateAcceleration34(void);
746static int32_T safe_cast_to_ENUM_CAN_STATUS_DI(int32_T input);
747
748/* Lookup Binary Search Utility BINARYSEARCH_real_T */
749void BINARYSEARCH_real_T(uint32_T *piLeft, uint32_T *piRght, real_T u, const
750 real_T *pData, uint32_T iHi)
751{
752 /* Find the location of current input value in the data table. */
753 *piLeft = 0U;
754 *piRght = iHi;
755 if (u <= pData[0] ) {
756 /* Less than or equal to the smallest point in the table. */
757 *piRght = 0U;
758 } else if (u >= pData[iHi] ) {
759 /* Greater than or equal to the largest point in the table. */
760 *piLeft = iHi;
761 } else {
762 uint32_T i;
763
764 /* Do a binary search. */
765 while (( *piRght - *piLeft ) > 1U ) {
766 /* Get the average of the left and right indices using to Floor rounding. */
767 i = (*piLeft + *piRght) >> 1;
768
769 /* Move either the right index or the left index so that */
770 /* LeftDataPoint <= CurrentValue < RightDataPoint */
771 if (u < pData[i] ) {
772 *piRght = i;
773 } else {
774 *piLeft = i;
775 }
776 }
777 }
778}
779
780/* Lookup Utility LookUp_real_T_real_T */
781void LookUp_real_T_real_T(real_T *pY, const real_T *pYData, real_T u, const
782 real_T *pUData, uint32_T iHi)
783{
784 uint32_T iLeft;
785 uint32_T iRght;
786 BINARYSEARCH_real_T( &(iLeft), &(iRght), u, pUData, iHi);
787
788 {
789 real_T lambda;
790 if (pUData[iRght] > pUData[iLeft] ) {
791 real_T num;
792 real_T den;
793 den = pUData[iRght];
794 den -= pUData[iLeft];
795 num = u;
796 num -= pUData[iLeft];
797 lambda = num / den;
798 } else {
799 lambda = 0.0;
800 }
801
802 {
803 real_T yLeftCast;
804 real_T yRghtCast;
805 yLeftCast = pYData[iLeft];
806 yRghtCast = pYData[iRght];
807 yLeftCast += lambda * ( yRghtCast - yLeftCast );
808 (*pY) = yLeftCast;
809 }
810 }
811}
812
813real_T look1_binlcapw(real_T u0, const real_T bp0[], const real_T table[],
814 uint32_T maxIndex)
815{
816 real_T y;
817 real_T frac;
818 uint32_T iRght;
819 uint32_T iLeft;
820 uint32_T bpIdx;
821
822 /* Lookup 1-D
823 Search method: 'binary'
824 Use previous index: 'off'
825 Interpolation method: 'Linear point-slope'
826 Extrapolation method: 'Clip'
827 Use last breakpoint for index at or above upper limit: 'on'
828 Remove protection against out-of-range input in generated code: 'off'
829 */
830 /* Prelookup - Index and Fraction
831 Index Search method: 'binary'
832 Extrapolation method: 'Clip'
833 Use previous index: 'off'
834 Use last breakpoint for index at or above upper limit: 'on'
835 Remove protection against out-of-range input in generated code: 'off'
836 */
837 if (u0 <= bp0[0U]) {
838 iLeft = 0U;
839 frac = 0.0;
840 } else if (u0 < bp0[maxIndex]) {
841 /* Binary Search */
842 bpIdx = maxIndex >> 1U;
843 iLeft = 0U;
844 iRght = maxIndex;
845 while (iRght - iLeft > 1U) {
846 if (u0 < bp0[bpIdx]) {
847 iRght = bpIdx;
848 } else {
849 iLeft = bpIdx;
850 }
851
852 bpIdx = (iRght + iLeft) >> 1U;
853 }
854
855 frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]);
856 } else {
857 iLeft = maxIndex;
858 frac = 0.0;
859 }
860
861 /* Interpolation 1-D
862 Interpolation method: 'Linear point-slope'
863 Use last breakpoint for index at or above upper limit: 'on'
864 Overflow mode: 'portable wrapping'
865 */
866 if (iLeft == maxIndex) {
867 y = table[iLeft];
868 } else {
869 y = (table[iLeft + 1U] - table[iLeft]) * frac + table[iLeft];
870 }
871
872 return y;
873}
874
875real_T look2_binlcapw(real_T u0, real_T u1, const real_T bp0[], const real_T
876 bp1[], const real_T table[], const uint32_T maxIndex[],
877 uint32_T stride)
878{
879 real_T y;
880 real_T frac;
881 uint32_T bpIndices[2];
882 real_T fractions[2];
883 real_T yR_1d;
884 uint32_T iRght;
885 uint32_T bpIdx;
886 uint32_T iLeft;
887
888 /* Lookup 2-D
889 Search method: 'binary'
890 Use previous index: 'off'
891 Interpolation method: 'Linear point-slope'
892 Extrapolation method: 'Clip'
893 Use last breakpoint for index at or above upper limit: 'on'
894 Remove protection against out-of-range input in generated code: 'off'
895 */
896 /* Prelookup - Index and Fraction
897 Index Search method: 'binary'
898 Extrapolation method: 'Clip'
899 Use previous index: 'off'
900 Use last breakpoint for index at or above upper limit: 'on'
901 Remove protection against out-of-range input in generated code: 'off'
902 */
903 if (u0 <= bp0[0U]) {
904 iLeft = 0U;
905 frac = 0.0;
906 } else if (u0 < bp0[maxIndex[0U]]) {
907 /* Binary Search */
908 bpIdx = maxIndex[0U] >> 1U;
909 iLeft = 0U;
910 iRght = maxIndex[0U];
911 while (iRght - iLeft > 1U) {
912 if (u0 < bp0[bpIdx]) {
913 iRght = bpIdx;
914 } else {
915 iLeft = bpIdx;
916 }
917
918 bpIdx = (iRght + iLeft) >> 1U;
919 }
920
921 frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]);
922 } else {
923 iLeft = maxIndex[0U];
924 frac = 0.0;
925 }
926
927 fractions[0U] = frac;
928 bpIndices[0U] = iLeft;
929
930 /* Prelookup - Index and Fraction
931 Index Search method: 'binary'
932 Extrapolation method: 'Clip'
933 Use previous index: 'off'
934 Use last breakpoint for index at or above upper limit: 'on'
935 Remove protection against out-of-range input in generated code: 'off'
936 */
937 if (u1 <= bp1[0U]) {
938 iLeft = 0U;
939 frac = 0.0;
940 } else if (u1 < bp1[maxIndex[1U]]) {
941 /* Binary Search */
942 bpIdx = maxIndex[1U] >> 1U;
943 iLeft = 0U;
944 iRght = maxIndex[1U];
945 while (iRght - iLeft > 1U) {
946 if (u1 < bp1[bpIdx]) {
947 iRght = bpIdx;
948 } else {
949 iLeft = bpIdx;
950 }
951
952 bpIdx = (iRght + iLeft) >> 1U;
953 }
954
955 frac = (u1 - bp1[iLeft]) / (bp1[iLeft + 1U] - bp1[iLeft]);
956 } else {
957 iLeft = maxIndex[1U];
958 frac = 0.0;
959 }
960
961 /* Interpolation 2-D
962 Interpolation method: 'Linear point-slope'
963 Use last breakpoint for index at or above upper limit: 'on'
964 Overflow mode: 'portable wrapping'
965 */
966 bpIdx = iLeft * stride + bpIndices[0U];
967 if (bpIndices[0U] == maxIndex[0U]) {
968 y = table[bpIdx];
969 } else {
970 y = (table[bpIdx + 1U] - table[bpIdx]) * fractions[0U] + table[bpIdx];
971 }
972
973 if (iLeft == maxIndex[1U]) {
974 } else {
975 bpIdx += stride;
976 if (bpIndices[0U] == maxIndex[0U]) {
977 yR_1d = table[bpIdx];
978 } else {
979 yR_1d = (table[bpIdx + 1U] - table[bpIdx]) * fractions[0U] + table[bpIdx];
980 }
981
982 y += (yR_1d - y) * frac;
983 }
984
985 return y;
986}
987
988real_T look1_binlxpw(real_T u0, const real_T bp0[], const real_T table[],
989 uint32_T maxIndex)
990{
991 real_T frac;
992 uint32_T iRght;
993 uint32_T iLeft;
994 uint32_T bpIdx;
995
996 /* Lookup 1-D
997 Search method: 'binary'
998 Use previous index: 'off'
999 Interpolation method: 'Linear point-slope'
1000 Extrapolation method: 'Linear'
1001 Use last breakpoint for index at or above upper limit: 'off'
1002 Remove protection against out-of-range input in generated code: 'off'
1003 */
1004 /* Prelookup - Index and Fraction
1005 Index Search method: 'binary'
1006 Extrapolation method: 'Linear'
1007 Use previous index: 'off'
1008 Use last breakpoint for index at or above upper limit: 'off'
1009 Remove protection against out-of-range input in generated code: 'off'
1010 */
1011 if (u0 <= bp0[0U]) {
1012 iLeft = 0U;
1013 frac = (u0 - bp0[0U]) / (bp0[1U] - bp0[0U]);
1014 } else if (u0 < bp0[maxIndex]) {
1015 /* Binary Search */
1016 bpIdx = maxIndex >> 1U;
1017 iLeft = 0U;
1018 iRght = maxIndex;
1019 while (iRght - iLeft > 1U) {
1020 if (u0 < bp0[bpIdx]) {
1021 iRght = bpIdx;
1022 } else {
1023 iLeft = bpIdx;
1024 }
1025
1026 bpIdx = (iRght + iLeft) >> 1U;
1027 }
1028
1029 frac = (u0 - bp0[iLeft]) / (bp0[iLeft + 1U] - bp0[iLeft]);
1030 } else {
1031 iLeft = maxIndex - 1U;
1032 frac = (u0 - bp0[maxIndex - 1U]) / (bp0[maxIndex] - bp0[maxIndex - 1U]);
1033 }
1034
1035 /* Interpolation 1-D
1036 Interpolation method: 'Linear point-slope'
1037 Use last breakpoint for index at or above upper limit: 'off'
1038 Overflow mode: 'portable wrapping'
1039 */
1040 return (table[iLeft + 1U] - table[iLeft]) * frac + table[iLeft];
1041}
1042
1043/*
1044 * Output and update for atomic system:
1045 * '<S82>/If_Then_Else'
1046 * '<S83>/If_Then_Else'
1047 * '<S83>/If_Then_Else1'
1048 * '<S89>/If_Then_Else'
1049 * '<S89>/If_Then_Else1'
1050 * '<S90>/If_Then_Else'
1051 * '<S90>/If_Then_Else1'
1052 * '<S121>/If_Then_Else'
1053 * '<S124>/If_Then_Else'
1054 * '<S126>/If_Then_Else'
1055 * ...
1056 */
1057void L4_MABX_If_Then_Else(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Else,
1058 B_If_Then_Else_L4_MABX_T *localB)
1059{
1060 /* Switch: '<S86>/Switch' */
1061 if (rtu_If) {
1062 localB->Switch = rtu_Then;
1063 } else {
1064 localB->Switch = rtu_Else;
1065 }
1066
1067 /* End of Switch: '<S86>/Switch' */
1068}
1069
1070/*
1071 * System initialize for enable system:
1072 * '<S112>/Calculate_D_term'
1073 * '<S150>/Calculate_D_term'
1074 * '<S244>/Calculate_D_term'
1075 */
1076void L4_MA_Calculate_D_term_Init(B_Calculate_D_term_L4_MABX_T *localB,
1077 DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP)
1078{
1079 /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay1' */
1080 localDW->Unit_Delay1_DSTATE = localP->Unit_Delay1_InitialCondition;
1081
1082 /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay2' */
1083 localDW->Unit_Delay2_DSTATE = localP->Unit_Delay2_InitialCondition;
1084
1085 /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay2' */
1086 localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio;
1087
1088 /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay1' */
1089 localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio;
1090
1091 /* SystemInitialize for Outport: '<S116>/GPID_d_term' */
1092 localB->Subtract = localP->GPID_d_term_Y0;
1093}
1094
1095/*
1096 * System reset for enable system:
1097 * '<S112>/Calculate_D_term'
1098 * '<S150>/Calculate_D_term'
1099 * '<S244>/Calculate_D_term'
1100 */
1101void L4_M_Calculate_D_term_Reset(DW_Calculate_D_term_L4_MABX_T *localDW,
1102 P_Calculate_D_term_L4_MABX_T *localP)
1103{
1104 /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay1' */
1105 localDW->Unit_Delay1_DSTATE = localP->Unit_Delay1_InitialCondition;
1106
1107 /* InitializeConditions for UnitDelay: '<S121>/Unit_Delay2' */
1108 localDW->Unit_Delay2_DSTATE = localP->Unit_Delay2_InitialCondition;
1109
1110 /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay2' */
1111 localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio;
1112
1113 /* InitializeConditions for UnitDelay: '<S122>/FixPt Unit Delay1' */
1114 localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio;
1115}
1116
1117/*
1118 * Disable for enable system:
1119 * '<S112>/Calculate_D_term'
1120 * '<S150>/Calculate_D_term'
1121 * '<S244>/Calculate_D_term'
1122 */
1123void L4_Calculate_D_term_Disable(B_Calculate_D_term_L4_MABX_T *localB,
1124 DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP)
1125{
1126 /* Disable for Outport: '<S116>/GPID_d_term' */
1127 localB->Subtract = localP->GPID_d_term_Y0;
1128 localDW->Calculate_D_term_MODE = false;
1129}
1130
1131/*
1132 * Start for enable system:
1133 * '<S112>/Calculate_D_term'
1134 * '<S150>/Calculate_D_term'
1135 * '<S244>/Calculate_D_term'
1136 */
1137void L4_M_Calculate_D_term_Start(DW_Calculate_D_term_L4_MABX_T *localDW)
1138{
1139 localDW->Calculate_D_term_MODE = false;
1140}
1141
1142/*
1143 * Outputs for enable system:
1144 * '<S112>/Calculate_D_term'
1145 * '<S150>/Calculate_D_term'
1146 * '<S244>/Calculate_D_term'
1147 */
1148void L4_MABX_Calculate_D_term(boolean_T rtu_Enable, real_T rtu_GPID_Kd, real_T
1149 rtu_GPID_dT, boolean_T rtu_F_GPID_reset_gov, real_T rtu_GPID_control_error,
1150 real_T rtu_GPID_T_filt_d, B_Calculate_D_term_L4_MABX_T *localB,
1151 DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP)
1152{
1153 real_T maxV;
1154 real_T u1;
1155 real_T u2;
1156
1157 /* Outputs for Enabled SubSystem: '<S112>/Calculate_D_term' incorporates:
1158 * EnablePort: '<S116>/Enable'
1159 */
1160 if (rtu_Enable) {
1161 if (!localDW->Calculate_D_term_MODE) {
1162 L4_M_Calculate_D_term_Reset(localDW, localP);
1163 localDW->Calculate_D_term_MODE = true;
1164 }
1165
1166 /* UnitDelay: '<S121>/Unit_Delay1' */
1167 localB->Unit_Delay1 = localDW->Unit_Delay1_DSTATE;
1168
1169 /* Logic: '<S121>/Logical Operator' */
1170 localB->LogicalOperator = (rtu_F_GPID_reset_gov || localB->Unit_Delay1);
1171
1172 /* MinMax: '<S121>/MinMax1' */
1173 if ((rtu_GPID_dT > rtu_GPID_T_filt_d) || rtIsNaN(rtu_GPID_T_filt_d)) {
1174 maxV = rtu_GPID_dT;
1175 } else {
1176 maxV = rtu_GPID_T_filt_d;
1177 }
1178
1179 localB->MinMax1 = maxV;
1180
1181 /* End of MinMax: '<S121>/MinMax1' */
1182
1183 /* Saturate: '<S121>/Saturation' */
1184 maxV = localB->MinMax1;
1185 u1 = localP->Saturation_LowerSat;
1186 u2 = localP->Saturation_UpperSat;
1187 if (maxV > u2) {
1188 localB->Saturation = u2;
1189 } else if (maxV < u1) {
1190 localB->Saturation = u1;
1191 } else {
1192 localB->Saturation = maxV;
1193 }
1194
1195 /* End of Saturate: '<S121>/Saturation' */
1196
1197 /* Product: '<S121>/Divide' */
1198 localB->Divide = rtu_GPID_dT / localB->Saturation;
1199
1200 /* Product: '<S121>/Product2' */
1201 localB->Product2 = rtu_GPID_control_error * localB->Divide;
1202
1203 /* Sum: '<S121>/Subtract1' incorporates:
1204 * Constant: '<S121>/Constant1'
1205 */
1206 localB->Subtract1 = localP->Constant1_Value - localB->Divide;
1207
1208 /* UnitDelay: '<S121>/Unit_Delay2' */
1209 localB->Unit_Delay2 = localDW->Unit_Delay2_DSTATE;
1210
1211 /* Product: '<S121>/Product1' */
1212 localB->Product1 = localB->Subtract1 * localB->Unit_Delay2;
1213
1214 /* Sum: '<S121>/Add1' */
1215 localB->Add1 = localB->Product2 + localB->Product1;
1216
1217 /* Outputs for Atomic SubSystem: '<S121>/If_Then_Else' */
1218 L4_MABX_If_Then_Else(localB->LogicalOperator, rtu_GPID_control_error,
1219 localB->Add1, &localB->If_Then_Else);
1220
1221 /* End of Outputs for SubSystem: '<S121>/If_Then_Else' */
1222
1223 /* Product: '<S116>/Divide' */
1224 localB->Divide_k = localB->If_Then_Else.Switch / rtu_GPID_dT * rtu_GPID_Kd;
1225
1226 /* UnitDelay: '<S122>/FixPt Unit Delay2' */
1227 localB->FixPtUnitDelay2 = localDW->FixPtUnitDelay2_DSTATE;
1228
1229 /* Logic: '<S122>/FixPt Logical Operator' */
1230 localB->FixPtLogicalOperator = (uint8_T)(rtu_F_GPID_reset_gov ||
1231 (localB->FixPtUnitDelay2 != 0));
1232
1233 /* UnitDelay: '<S122>/FixPt Unit Delay1' */
1234 localB->Xold = localDW->FixPtUnitDelay1_DSTATE;
1235
1236 /* Switch: '<S122>/Init' */
1237 if (localB->FixPtLogicalOperator != 0) {
1238 localB->Init = localB->Divide_k;
1239 } else {
1240 localB->Init = localB->Xold;
1241 }
1242
1243 /* End of Switch: '<S122>/Init' */
1244
1245 /* Sum: '<S116>/Subtract' */
1246 localB->Subtract = localB->Divide_k - localB->Init;
1247
1248 /* Switch: '<S122>/Reset' */
1249 localB->Xnew = localB->Divide_k;
1250 } else {
1251 if (localDW->Calculate_D_term_MODE) {
1252 L4_Calculate_D_term_Disable(localB, localDW, localP);
1253 }
1254 }
1255
1256 /* End of Outputs for SubSystem: '<S112>/Calculate_D_term' */
1257}
1258
1259/*
1260 * Update for enable system:
1261 * '<S112>/Calculate_D_term'
1262 * '<S150>/Calculate_D_term'
1263 * '<S244>/Calculate_D_term'
1264 */
1265void L4__Calculate_D_term_Update(B_Calculate_D_term_L4_MABX_T *localB,
1266 DW_Calculate_D_term_L4_MABX_T *localDW, P_Calculate_D_term_L4_MABX_T *localP)
1267{
1268 /* Update for Enabled SubSystem: '<S112>/Calculate_D_term' incorporates:
1269 * EnablePort: '<S116>/Enable'
1270 */
1271 if (localDW->Calculate_D_term_MODE) {
1272 /* Update for UnitDelay: '<S121>/Unit_Delay1' incorporates:
1273 * Constant: '<S121>/Constant'
1274 */
1275 localDW->Unit_Delay1_DSTATE = localP->Constant_Value;
1276
1277 /* Update for UnitDelay: '<S121>/Unit_Delay2' */
1278 localDW->Unit_Delay2_DSTATE = localB->If_Then_Else.Switch;
1279
1280 /* Update for UnitDelay: '<S122>/FixPt Unit Delay2' incorporates:
1281 * Constant: '<S122>/FixPt Constant'
1282 */
1283 localDW->FixPtUnitDelay2_DSTATE = localP->FixPtConstant_Value;
1284
1285 /* Update for UnitDelay: '<S122>/FixPt Unit Delay1' */
1286 localDW->FixPtUnitDelay1_DSTATE = localB->Xnew;
1287 }
1288
1289 /* End of Update for SubSystem: '<S112>/Calculate_D_term' */
1290}
1291
1292/*
1293 * Output and update for atomic system:
1294 * '<S126>/If_Then_Else3'
1295 * '<S164>/If_Then_Else3'
1296 * '<S258>/If_Then_Else3'
1297 * '<S466>/If_Then_Else'
1298 * '<S1076>/If_Then_Else'
1299 */
1300void L4_MABX_If_Then_Else3(boolean_T rtu_If, boolean_T rtu_Then, boolean_T
1301 rtu_Else, B_If_Then_Else_L4_MABX_c_T *localB)
1302{
1303 /* Switch: '<S134>/Switch' */
1304 if (rtu_If) {
1305 localB->Switch = rtu_Then;
1306 } else {
1307 localB->Switch = rtu_Else;
1308 }
1309
1310 /* End of Switch: '<S134>/Switch' */
1311}
1312
1313/*
1314 * System initialize for enable system:
1315 * '<S112>/Calculate_I_term'
1316 * '<S150>/Calculate_I_term'
1317 * '<S244>/Calculate_I_term'
1318 */
1319void L4_MA_Calculate_I_term_Init(B_Calculate_I_term_L4_MABX_T *localB,
1320 DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP)
1321{
1322 /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay2' */
1323 localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio;
1324
1325 /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay1' */
1326 localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio;
1327
1328 /* InitializeConditions for UnitDelay: '<S117>/Unit_Delay' */
1329 localDW->Unit_Delay_DSTATE = localP->Unit_Delay_InitialCondition;
1330
1331 /* SystemInitialize for Enabled SubSystem: '<S117>/Initialize_integral_term' */
1332 /* SystemInitialize for Outport: '<S125>/GPID_i_sum_error_init' */
1333 localB->Subtract2 = localP->GPID_i_sum_error_init_Y0;
1334
1335 /* End of SystemInitialize for SubSystem: '<S117>/Initialize_integral_term' */
1336
1337 /* SystemInitialize for Outport: '<S117>/GPID_i_term' */
1338 localB->If_Then_Else.Switch = localP->GPID_i_term_Y0;
1339
1340 /* SystemInitialize for Outport: '<S117>/F_GPID_hold_i_term' */
1341 localB->LogicalOperator2 = localP->F_GPID_hold_i_term_Y0;
1342}
1343
1344/*
1345 * System reset for enable system:
1346 * '<S112>/Calculate_I_term'
1347 * '<S150>/Calculate_I_term'
1348 * '<S244>/Calculate_I_term'
1349 */
1350void L4_M_Calculate_I_term_Reset(DW_Calculate_I_term_L4_MABX_T *localDW,
1351 P_Calculate_I_term_L4_MABX_T *localP)
1352{
1353 /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay2' */
1354 localDW->FixPtUnitDelay2_DSTATE = localP->FixPtUnitDelay2_InitialConditio;
1355
1356 /* InitializeConditions for UnitDelay: '<S128>/FixPt Unit Delay1' */
1357 localDW->FixPtUnitDelay1_DSTATE = localP->FixPtUnitDelay1_InitialConditio;
1358
1359 /* InitializeConditions for UnitDelay: '<S117>/Unit_Delay' */
1360 localDW->Unit_Delay_DSTATE = localP->Unit_Delay_InitialCondition;
1361}
1362
1363/*
1364 * Disable for enable system:
1365 * '<S112>/Calculate_I_term'
1366 * '<S150>/Calculate_I_term'
1367 * '<S244>/Calculate_I_term'
1368 */
1369void L4_Calculate_I_term_Disable(B_Calculate_I_term_L4_MABX_T *localB,
1370 DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP)
1371{
1372 /* Disable for Outport: '<S117>/GPID_i_term' */
1373 localB->If_Then_Else.Switch = localP->GPID_i_term_Y0;
1374
1375 /* Disable for Outport: '<S117>/F_GPID_hold_i_term' */
1376 localB->LogicalOperator2 = localP->F_GPID_hold_i_term_Y0;
1377 localDW->Calculate_I_term_MODE = false;
1378}
1379
1380/*
1381 * Start for enable system:
1382 * '<S112>/Calculate_I_term'
1383 * '<S150>/Calculate_I_term'
1384 * '<S244>/Calculate_I_term'
1385 */
1386void L4_M_Calculate_I_term_Start(DW_Calculate_I_term_L4_MABX_T *localDW)
1387{
1388 localDW->Calculate_I_term_MODE = false;
1389}
1390
1391/*
1392 * Outputs for enable system:
1393 * '<S112>/Calculate_I_term'
1394 * '<S150>/Calculate_I_term'
1395 * '<S244>/Calculate_I_term'
1396 */
1397void L4_MABX_Calculate_I_term(boolean_T rtu_Enable, real_T rtu_GPID_p_term,
1398 real_T rtu_GPID_Ki, real_T rtu_GPID_actual_system_output, real_T
1399 rtu_GPID_control_error, boolean_T rtu_F_GPID_reset_gov, real_T rtu_GPID_dT,
1400 real_T rtu_GPID_feed_forward, boolean_T rtu_F_GPID_aw_cond_integration, real_T
1401 rtu_GPID_aw_hysteresis, boolean_T rtu_F_GPID_aw_hold_i_term, real_T
1402 rtu_GPID_output_unlim_prev, B_Calculate_I_term_L4_MABX_T *localB,
1403 DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP)
1404{
1405 /* Outputs for Enabled SubSystem: '<S112>/Calculate_I_term' incorporates:
1406 * EnablePort: '<S117>/Enable'
1407 */
1408 if (rtu_Enable) {
1409 if (!localDW->Calculate_I_term_MODE) {
1410 L4_M_Calculate_I_term_Reset(localDW, localP);
1411 localDW->Calculate_I_term_MODE = true;
1412 }
1413
1414 /* Outputs for Enabled SubSystem: '<S117>/Initialize_integral_term' incorporates:
1415 * EnablePort: '<S125>/Enable'
1416 */
1417 if (rtu_F_GPID_reset_gov) {
1418 /* Product: '<S125>/Product' */
1419 localB->Product_j = rtu_GPID_Ki * rtu_GPID_dT * rtu_GPID_control_error;
1420
1421 /* Sum: '<S125>/Subtract' */
1422 localB->Subtract_g = rtu_GPID_actual_system_output - rtu_GPID_feed_forward;
1423
1424 /* Sum: '<S125>/Subtract1' */
1425 localB->Subtract1_k = localB->Subtract_g - rtu_GPID_p_term;
1426
1427 /* Sum: '<S125>/Subtract2' */
1428 localB->Subtract2 = localB->Subtract1_k - localB->Product_j;
1429 }
1430
1431 /* End of Outputs for SubSystem: '<S117>/Initialize_integral_term' */
1432
1433 /* UnitDelay: '<S128>/FixPt Unit Delay2' */
1434 localB->FixPtUnitDelay2 = localDW->FixPtUnitDelay2_DSTATE;
1435
1436 /* Logic: '<S128>/FixPt Logical Operator' */
1437 localB->FixPtLogicalOperator = (uint8_T)(rtu_F_GPID_reset_gov ||
1438 (localB->FixPtUnitDelay2 != 0));
1439
1440 /* UnitDelay: '<S128>/FixPt Unit Delay1' */
1441 localB->Xold = localDW->FixPtUnitDelay1_DSTATE;
1442
1443 /* Switch: '<S128>/Init' */
1444 if (localB->FixPtLogicalOperator != 0) {
1445 localB->Init = localB->Subtract2;
1446 } else {
1447 localB->Init = localB->Xold;
1448 }
1449
1450 /* End of Switch: '<S128>/Init' */
1451
1452 /* Product: '<S124>/Product1' */
1453 localB->Product1 = rtu_GPID_Ki * rtu_GPID_control_error * rtu_GPID_dT;
1454
1455 /* Sum: '<S124>/Add' */
1456 localB->Add = localB->Init + localB->Product1;
1457
1458 /* UnitDelay: '<S117>/Unit_Delay' */
1459 localB->Unit_Delay = localDW->Unit_Delay_DSTATE;
1460
1461 /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else' */
1462
1463 /* Constant: '<S126>/Constant' */
1464 L4_MABX_If_Then_Else(rtu_F_GPID_reset_gov, localP->Constant_Value,
1465 localB->Unit_Delay, &localB->If_Then_Else_c);
1466
1467 /* End of Outputs for SubSystem: '<S126>/If_Then_Else' */
1468
1469 /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else2' */
1470 L4_MABX_If_Then_Else(rtu_F_GPID_reset_gov, rtu_GPID_actual_system_output,
1471 rtu_GPID_output_unlim_prev, &localB->If_Then_Else2);
1472
1473 /* End of Outputs for SubSystem: '<S126>/If_Then_Else2' */
1474
1475 /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else1' */
1476 L4_MABX_If_Then_Else(rtu_F_GPID_aw_cond_integration,
1477 localB->If_Then_Else_c.Switch,
1478 localB->If_Then_Else2.Switch, &localB->If_Then_Else1);
1479
1480 /* End of Outputs for SubSystem: '<S126>/If_Then_Else1' */
1481
1482 /* Product: '<S126>/Product' */
1483 localB->Product = rtu_GPID_Ki * rtu_GPID_control_error *
1484 localB->If_Then_Else1.Switch;
1485
1486 /* RelationalOperator: '<S129>/Compare' incorporates:
1487 * Constant: '<S129>/Constant'
1488 */
1489 localB->Compare = (localB->Product > localP->Constant_Value_p);
1490
1491 /* RelationalOperator: '<S130>/Compare' incorporates:
1492 * Constant: '<S130>/Constant'
1493 */
1494 localB->Compare_n = (localB->Unit_Delay >= localP->Constant_Value_b);
1495
1496 /* Sum: '<S126>/Subtract' */
1497 localB->Subtract = localB->If_Then_Else2.Switch -
1498 rtu_GPID_actual_system_output;
1499
1500 /* RelationalOperator: '<S126>/Relational Operator1' */
1501 localB->RelationalOperator1 = (localB->Subtract > rtu_GPID_aw_hysteresis);
1502
1503 /* Sum: '<S126>/Subtract1' */
1504 localB->Subtract1 = rtu_GPID_actual_system_output -
1505 localB->If_Then_Else2.Switch;
1506
1507 /* RelationalOperator: '<S126>/Relational Operator2' */
1508 localB->RelationalOperator2 = (localB->Subtract1 > rtu_GPID_aw_hysteresis);
1509
1510 /* Outputs for Atomic SubSystem: '<S126>/If_Then_Else3' */
1511 L4_MABX_If_Then_Else3(localB->Compare_n, localB->RelationalOperator1,
1512 localB->RelationalOperator2, &localB->If_Then_Else3);
1513
1514 /* End of Outputs for SubSystem: '<S126>/If_Then_Else3' */
1515
1516 /* Logic: '<S126>/Logical Operator1' */
1517 localB->LogicalOperator1 = (localB->Compare && localB->If_Then_Else3.Switch);
1518
1519 /* Logic: '<S126>/Logical Operator2' */
1520 localB->LogicalOperator2 = (localB->LogicalOperator1 ||
1521 rtu_F_GPID_aw_hold_i_term);
1522
1523 /* Outputs for Atomic SubSystem: '<S124>/If_Then_Else' */
1524 L4_MABX_If_Then_Else(localB->LogicalOperator2, localB->Init, localB->Add,
1525 &localB->If_Then_Else);
1526
1527 /* End of Outputs for SubSystem: '<S124>/If_Then_Else' */
1528
1529 /* Switch: '<S128>/Reset' */
1530 if (rtu_F_GPID_reset_gov) {
1531 localB->Xnew = localB->Subtract2;
1532 } else {
1533 localB->Xnew = localB->If_Then_Else.Switch;
1534 }
1535
1536 /* End of Switch: '<S128>/Reset' */
1537 } else {
1538 if (localDW->Calculate_I_term_MODE) {
1539 L4_Calculate_I_term_Disable(localB, localDW, localP);
1540 }
1541 }
1542
1543 /* End of Outputs for SubSystem: '<S112>/Calculate_I_term' */
1544}
1545
1546/*
1547 * Update for enable system:
1548 * '<S112>/Calculate_I_term'
1549 * '<S150>/Calculate_I_term'
1550 * '<S244>/Calculate_I_term'
1551 */
1552void L4__Calculate_I_term_Update(B_Calculate_I_term_L4_MABX_T *localB,
1553 DW_Calculate_I_term_L4_MABX_T *localDW, P_Calculate_I_term_L4_MABX_T *localP)
1554{
1555 /* Update for Enabled SubSystem: '<S112>/Calculate_I_term' incorporates:
1556 * EnablePort: '<S117>/Enable'
1557 */
1558 if (localDW->Calculate_I_term_MODE) {
1559 /* Update for UnitDelay: '<S128>/FixPt Unit Delay2' incorporates:
1560 * Constant: '<S128>/FixPt Constant'
1561 */
1562 localDW->FixPtUnitDelay2_DSTATE = localP->FixPtConstant_Value;
1563
1564 /* Update for UnitDelay: '<S128>/FixPt Unit Delay1' */
1565 localDW->FixPtUnitDelay1_DSTATE = localB->Xnew;
1566
1567 /* Update for UnitDelay: '<S117>/Unit_Delay' */
1568 localDW->Unit_Delay_DSTATE = localB->If_Then_Else.Switch;
1569 }
1570
1571 /* End of Update for SubSystem: '<S112>/Calculate_I_term' */
1572}
1573
1574/* Output and update for atomic system: '<S104>/If_Then_Else' */
1575void L4_MABX_If_Then_Else_l(boolean_T rtu_If, boolean_T rtu_Then, boolean_T
1576 rtu_Else, B_If_Then_Else_L4_MABX_m_T *localB)
1577{
1578 /* Switch: '<S182>/Switch' */
1579 if (rtu_If) {
1580 localB->Switch = rtu_Then;
1581 } else {
1582 localB->Switch = rtu_Else;
1583 }
1584
1585 /* End of Switch: '<S182>/Switch' */
1586}
1587
1588/*
1589 * Output and update for atomic system:
1590 * '<S183>/If_Then_Else'
1591 * '<S183>/If_Then_Else1'
1592 * '<S184>/If_Then_Else'
1593 * '<S184>/If_Then_Else1'
1594 * '<S280>/If_Then_Else'
1595 * '<S281>/If_Then_Else'
1596 * '<S281>/If_Then_Else1'
1597 * '<S360>/If_Then_Else'
1598 * '<S357>/If_Then_Else'
1599 * '<S366>/If_Then_Else'
1600 * ...
1601 */
1602void L4_MABX_If_Then_Else_g(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Else,
1603 B_If_Then_Else_L4_MABX_k_T *localB)
1604{
1605 /* Switch: '<S185>/Switch' */
1606 if (rtu_If) {
1607 localB->Switch = rtu_Then;
1608 } else {
1609 localB->Switch = rtu_Else;
1610 }
1611
1612 /* End of Switch: '<S185>/Switch' */
1613}
1614
1615/* Output and update for atomic system: '<S310>/If_Then_Else' */
1616void L4_MABX_If_Then_Else_c(real_T rtu_If, real_T rtu_Then, real_T rtu_Else,
1617 B_If_Then_Else_L4_MABX_mf_T *localB)
1618{
1619 /* Switch: '<S320>/Switch' */
1620 if (rtu_If != 0.0) {
1621 localB->Switch = rtu_Then;
1622 } else {
1623 localB->Switch = rtu_Else;
1624 }
1625
1626 /* End of Switch: '<S320>/Switch' */
1627}
1628
1629/* Output and update for atomic system: '<S350>/If_Then_Else' */
1630void L4_MABX_If_Then_Else_m(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Then_l,
1631 real_T rtu_Then_f, real_T rtu_Else, real_T rtu_Else_i, real_T rtu_Else_k,
1632 B_If_Then_Else_L4_MABX_h_T *localB)
1633{
1634 /* Switch: '<S352>/Switch' */
1635 if (rtu_If) {
1636 localB->Vehicle_speed_target = rtu_Then;
1637 localB->Vehicle_speed = rtu_Then_l;
1638 localB->Distance_m = rtu_Then_f;
1639 } else {
1640 localB->Vehicle_speed_target = rtu_Else;
1641 localB->Vehicle_speed = rtu_Else_i;
1642 localB->Distance_m = rtu_Else_k;
1643 }
1644
1645 /* End of Switch: '<S352>/Switch' */
1646}
1647
1648/* System initialize for function-call system: '<S399>/Background_Task' */
1649void L4_MAB_Background_Task_Init(void)
1650{
1651 /* InitializeConditions for S-Function (dsa_tcpip_bkg_sfcn): '<S409>/dsa_tcpip_bkg_sfcn' */
1652 /* Level2 S-Function Block: '<S409>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */
1653 {
1654 SimStruct *rts = L4_MABX_M->childSfunctions[0];
1655 sfcnInitializeConditions(rts);
1656 if (ssGetErrorStatus(rts) != (NULL))
1657 return;
1658 }
1659}
1660
1661/* System reset for function-call system: '<S399>/Background_Task' */
1662void L4_MA_Background_Task_Reset(void)
1663{
1664 /* InitializeConditions for S-Function (dsa_tcpip_bkg_sfcn): '<S409>/dsa_tcpip_bkg_sfcn' */
1665 /* Level2 S-Function Block: '<S409>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */
1666 {
1667 SimStruct *rts = L4_MABX_M->childSfunctions[0];
1668 sfcnInitializeConditions(rts);
1669 if (ssGetErrorStatus(rts) != (NULL))
1670 return;
1671 }
1672}
1673
1674/* Start for function-call system: '<S399>/Background_Task' */
1675void L4_MA_Background_Task_Start(void)
1676{
1677 /* Start for S-Function (dsa_tcpip_bkg_sfcn): '<S409>/dsa_tcpip_bkg_sfcn' */
1678 /* Level2 S-Function Block: '<S409>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */
1679 {
1680 SimStruct *rts = L4_MABX_M->childSfunctions[0];
1681 sfcnStart(rts);
1682 if (ssGetErrorStatus(rts) != (NULL))
1683 return;
1684 }
1685}
1686
1687/* Output and update for function-call system: '<S399>/Background_Task' */
1688void L4_MABX_Background_Task(void)
1689{
1690 /* S-Function (dsa_tcpip_bkg_sfcn): '<S409>/dsa_tcpip_bkg_sfcn' */
1691
1692 /* Level2 S-Function Block: '<S409>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */
1693 {
1694 SimStruct *rts = L4_MABX_M->childSfunctions[0];
1695 sfcnOutputs(rts,9);
1696 }
1697}
1698
1699/* Termination for function-call system: '<S399>/Background_Task' */
1700void L4_MAB_Background_Task_Term(void)
1701{
1702 /* Terminate for S-Function (dsa_tcpip_bkg_sfcn): '<S409>/dsa_tcpip_bkg_sfcn' */
1703 /* Level2 S-Function Block: '<S409>/dsa_tcpip_bkg_sfcn' (dsa_tcpip_bkg_sfcn) */
1704 {
1705 SimStruct *rts = L4_MABX_M->childSfunctions[0];
1706 sfcnTerminate(rts);
1707 }
1708}
1709
1710/* System initialize for function-call system: '<S399>/IRQ_Level_2_SW_INT' */
1711void L4__IRQ_Level_2_SW_INT_Init(void)
1712{
1713 /* InitializeConditions for S-Function (dsa_tcpip_irq_l2_sfcn): '<S410>/dsa_tcpip_irq_l2_sfcn' */
1714 /* Level2 S-Function Block: '<S410>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */
1715 {
1716 SimStruct *rts = L4_MABX_M->childSfunctions[1];
1717 sfcnInitializeConditions(rts);
1718 if (ssGetErrorStatus(rts) != (NULL))
1719 return;
1720 }
1721}
1722
1723/* System reset for function-call system: '<S399>/IRQ_Level_2_SW_INT' */
1724void L4_IRQ_Level_2_SW_INT_Reset(void)
1725{
1726 /* InitializeConditions for S-Function (dsa_tcpip_irq_l2_sfcn): '<S410>/dsa_tcpip_irq_l2_sfcn' */
1727 /* Level2 S-Function Block: '<S410>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */
1728 {
1729 SimStruct *rts = L4_MABX_M->childSfunctions[1];
1730 sfcnInitializeConditions(rts);
1731 if (ssGetErrorStatus(rts) != (NULL))
1732 return;
1733 }
1734}
1735
1736/* Start for function-call system: '<S399>/IRQ_Level_2_SW_INT' */
1737void L4_IRQ_Level_2_SW_INT_Start(void)
1738{
1739 /* Start for S-Function (dsa_tcpip_irq_l2_sfcn): '<S410>/dsa_tcpip_irq_l2_sfcn' */
1740 /* Level2 S-Function Block: '<S410>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */
1741 {
1742 SimStruct *rts = L4_MABX_M->childSfunctions[1];
1743 sfcnStart(rts);
1744 if (ssGetErrorStatus(rts) != (NULL))
1745 return;
1746 }
1747}
1748
1749/* Output and update for function-call system: '<S399>/IRQ_Level_2_SW_INT' */
1750void L4_MABX_IRQ_Level_2_SW_INT(void)
1751{
1752 /* S-Function (dsa_tcpip_irq_l2_sfcn): '<S410>/dsa_tcpip_irq_l2_sfcn' */
1753
1754 /* Level2 S-Function Block: '<S410>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */
1755 {
1756 SimStruct *rts = L4_MABX_M->childSfunctions[1];
1757 sfcnOutputs(rts,10);
1758 }
1759}
1760
1761/* Termination for function-call system: '<S399>/IRQ_Level_2_SW_INT' */
1762void L4__IRQ_Level_2_SW_INT_Term(void)
1763{
1764 /* Terminate for S-Function (dsa_tcpip_irq_l2_sfcn): '<S410>/dsa_tcpip_irq_l2_sfcn' */
1765 /* Level2 S-Function Block: '<S410>/dsa_tcpip_irq_l2_sfcn' (dsa_tcpip_irq_l2_sfcn) */
1766 {
1767 SimStruct *rts = L4_MABX_M->childSfunctions[1];
1768 sfcnTerminate(rts);
1769 }
1770}
1771
1772/* System initialize for function-call system: '<S411>/Tcp Input Processing' */
1773void L4__TcpInputProcessing_Init(void)
1774{
1775 /* SystemInitialize for S-Function (rti_commonblock): '<S413>/S-Function1' incorporates:
1776 * SubSystem: '<S399>/IRQ_Level_2_SW_INT'
1777 */
1778 L4__IRQ_Level_2_SW_INT_Init();
1779
1780 /* End of SystemInitialize for S-Function (rti_commonblock): '<S413>/S-Function1' */
1781}
1782
1783/* System reset for function-call system: '<S411>/Tcp Input Processing' */
1784void L4_TcpInputProcessing_Reset(void)
1785{
1786 /* SystemReset for S-Function (rti_commonblock): '<S413>/S-Function1' incorporates:
1787 * SubSystem: '<S399>/IRQ_Level_2_SW_INT'
1788 */
1789 L4_IRQ_Level_2_SW_INT_Reset();
1790
1791 /* End of SystemReset for S-Function (rti_commonblock): '<S413>/S-Function1' */
1792}
1793
1794/* Start for function-call system: '<S411>/Tcp Input Processing' */
1795void L4_TcpInputProcessing_Start(void)
1796{
1797 /* Start for S-Function (rti_commonblock): '<S413>/S-Function1' incorporates:
1798 * SubSystem: '<S399>/IRQ_Level_2_SW_INT'
1799 */
1800 L4_IRQ_Level_2_SW_INT_Start();
1801
1802 /* End of Start for S-Function (rti_commonblock): '<S413>/S-Function1' */
1803}
1804
1805/* Output and update for function-call system: '<S411>/Tcp Input Processing' */
1806void L4_MABX_TcpInputProcessing(void)
1807{
1808 /* S-Function (rti_commonblock): '<S413>/S-Function1' */
1809
1810 /* This comment workarounds a code generation problem */
1811
1812 /* dSPACE Software Interrupt Block: <S411>/Tcp Input Processing */
1813 rtk_schedule_task(S_SOFTTASK,0);
1814
1815 /* End of Outputs for S-Function (rti_commonblock): '<S413>/S-Function1' */
1816}
1817
1818/*
1819 * Forced non-inlined (FNI) function call stub
1820 * for '<S411>/Tcp Input Processing'
1821 */
1822boolean_T L4_MABX_TcpInputProcessingFNI(RT_MODEL_L4_MABX_T *const L4_MABX_M,
1823 int_T controlPortIdx, int_T tid)
1824{
1825 L4_MABX_TcpInputProcessing();
1826 UNUSED_PARAMETER(L4_MABX_M);
1827 UNUSED_PARAMETER(controlPortIdx);
1828 UNUSED_PARAMETER(tid);
1829 return (1);
1830}
1831
1832/*
1833 * Forced non-inlined (FNI) function call stub
1834 * for '<S411>/Tcp Input Processing'
1835 */
1836boolean_T L4_TcpInputProcessing_ResetFNI(RT_MODEL_L4_MABX_T *const L4_MABX_M,
1837 int_T controlPortIdx, int_T tid)
1838{
1839 UNUSED_PARAMETER(L4_MABX_M);
1840 UNUSED_PARAMETER(controlPortIdx);
1841 UNUSED_PARAMETER(tid);
1842 return (1);
1843}
1844
1845/* Termination for function-call system: '<S411>/Tcp Input Processing' */
1846void L4__TcpInputProcessing_Term(void)
1847{
1848 /* Terminate for S-Function (rti_commonblock): '<S413>/S-Function1' incorporates:
1849 * SubSystem: '<S399>/IRQ_Level_2_SW_INT'
1850 */
1851 L4__IRQ_Level_2_SW_INT_Term();
1852
1853 /* End of Terminate for S-Function (rti_commonblock): '<S413>/S-Function1' */
1854}
1855
1856/* System initialize for function-call system: '<S399>/Interrupt_Task' */
1857void L4_MABX_Interrupt_Task_Init(void)
1858{
1859 /* InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1860
1861 /* Level2 S-Function Block: '<S411>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */
1862 {
1863 SimStruct *rts = L4_MABX_M->childSfunctions[2];
1864 sfcnInitializeConditions(rts);
1865 if (ssGetErrorStatus(rts) != (NULL))
1866 return;
1867 }
1868
1869 /* End of InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1870
1871 /* SystemInitialize for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' incorporates:
1872 * SubSystem: '<S411>/Tcp Input Processing'
1873 */
1874 L4__TcpInputProcessing_Init();
1875
1876 /* End of SystemInitialize for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1877}
1878
1879/* System reset for function-call system: '<S399>/Interrupt_Task' */
1880void L4_MAB_Interrupt_Task_Reset(void)
1881{
1882 /* InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1883
1884 /* Level2 S-Function Block: '<S411>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */
1885 {
1886 SimStruct *rts = L4_MABX_M->childSfunctions[2];
1887 sfcnInitializeConditions(rts);
1888 if (ssGetErrorStatus(rts) != (NULL))
1889 return;
1890 }
1891
1892 /* End of InitializeConditions for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1893
1894 /* SystemReset for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' incorporates:
1895 * SubSystem: '<S411>/Tcp Input Processing'
1896 */
1897 L4_TcpInputProcessing_Reset();
1898
1899 /* End of SystemReset for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1900}
1901
1902/* Start for function-call system: '<S399>/Interrupt_Task' */
1903void L4_MAB_Interrupt_Task_Start(void)
1904{
1905 /* Start for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' incorporates:
1906 * SubSystem: '<S411>/Tcp Input Processing'
1907 */
1908 L4_TcpInputProcessing_Start();
1909
1910 /* Level2 S-Function Block: '<S411>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */
1911 {
1912 SimStruct *rts = L4_MABX_M->childSfunctions[2];
1913 sfcnStart(rts);
1914 if (ssGetErrorStatus(rts) != (NULL))
1915 return;
1916 }
1917
1918 /* End of Start for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1919}
1920
1921/* Output and update for function-call system: '<S399>/Interrupt_Task' */
1922void L4_MABX_Interrupt_Task(void)
1923{
1924 /* S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1925
1926 /* Level2 S-Function Block: '<S411>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */
1927 {
1928 SimStruct *rts = L4_MABX_M->childSfunctions[2];
1929 sfcnOutputs(rts,11);
1930 }
1931
1932 /* End of Outputs for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1933}
1934
1935/* Termination for function-call system: '<S399>/Interrupt_Task' */
1936void L4_MABX_Interrupt_Task_Term(void)
1937{
1938 /* Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1939
1940 /* Level2 S-Function Block: '<S411>/dsa_tcpip_irq_l1_sfcn' (dsa_tcpip_irq_l1_sfcn) */
1941 {
1942 SimStruct *rts = L4_MABX_M->childSfunctions[2];
1943 sfcnTerminate(rts);
1944 }
1945
1946 /* End of Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1947
1948 /* Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' incorporates:
1949 * SubSystem: '<S411>/Tcp Input Processing'
1950 */
1951 L4__TcpInputProcessing_Term();
1952
1953 /* End of Terminate for S-Function (dsa_tcpip_irq_l1_sfcn): '<S411>/dsa_tcpip_irq_l1_sfcn' */
1954}
1955
1956/* Output and update for atomic system: '<S744>/If_Then_Else' */
1957void L4_MABX_If_Then_Else_b(boolean_T rtu_If, real_T rtu_Then, real_T rtu_Else)
1958{
1959 /* Switch: '<S765>/Switch' */
1960 if (rtu_If) {
1961 Pedal_pwm_position = rtu_Then;
1962 } else {
1963 Pedal_pwm_position = rtu_Else;
1964 }
1965
1966 /* End of Switch: '<S765>/Switch' */
1967}
1968
1969/* System initialize for function-call system: '<S417>/IncrementTimer' */
1970void L4_MABX_IncrementTimer_Init(void)
1971{
1972 /* InitializeConditions for UnitDelay: '<S847>/Unit_Delay' */
1973 L4_MABX_DW.Unit_Delay_DSTATE_l = L4_MABX_P.Unit_Delay_InitialCondition_g;
1974
1975 /* SystemInitialize for Outport: '<S847>/Out1' */
1976 L4_MABX_B.Add = L4_MABX_P.Out1_Y0_g;
1977}
1978
1979/* System reset for function-call system: '<S417>/IncrementTimer' */
1980void L4_MAB_IncrementTimer_Reset(void)
1981{
1982 /* InitializeConditions for UnitDelay: '<S847>/Unit_Delay' */
1983 L4_MABX_DW.Unit_Delay_DSTATE_l = L4_MABX_P.Unit_Delay_InitialCondition_g;
1984}
1985
1986/* Output and update for function-call system: '<S417>/IncrementTimer' */
1987void L4_MABX_IncrementTimer(void)
1988{
1989 /* UnitDelay: '<S847>/Unit_Delay' */
1990 L4_MABX_B.Unit_Delay_c = L4_MABX_DW.Unit_Delay_DSTATE_l;
1991
1992 /* Sum: '<S847>/Add' incorporates:
1993 * Constant: '<S847>/Constant1'
1994 */
1995 L4_MABX_B.Add = L4_MABX_P.Constant1_Value_b + L4_MABX_B.Unit_Delay_c;
1996
1997 /* Update for UnitDelay: '<S847>/Unit_Delay' */
1998 L4_MABX_DW.Unit_Delay_DSTATE_l = L4_MABX_B.Add;
1999}
2000
2001/*
2002 * Output and update for enable system:
2003 * '<S977>/ALL_CTRL_DISABLED'
2004 * '<S977>/DEFAULT_TRQ_CTRL_MODE'
2005 * '<S977>/EXT_TRQ_CTRL_MODE_A'
2006 * '<S977>/EXT_TRQ_CTRL_MODE_B'
2007 * '<S977>/EXT_TRQ_CTRL_MODE_C'
2008 */
2009void L4_MABX_ALL_CTRL_DISABLED(boolean_T rtu_Enable, int32_T *rty_Out1,
2010 P_ALL_CTRL_DISABLED_L4_MABX_T *localP)
2011{
2012 /* Outputs for Enabled SubSystem: '<S977>/ALL_CTRL_DISABLED' incorporates:
2013 * EnablePort: '<S992>/Enable'
2014 */
2015 if (rtu_Enable) {
2016 /* SignalConversion: '<S992>/OutportBufferForOut1' incorporates:
2017 * Constant: '<S992>/Constant'
2018 */
2019 *rty_Out1 = localP->Constant_Value;
2020 }
2021
2022 /* End of Outputs for SubSystem: '<S977>/ALL_CTRL_DISABLED' */
2023}
2024
2025/* Output and update for atomic system: '<S1015>/If_Then_Else' */
2026void L4_MABX_If_Then_Else_d(boolean_T rtu_If, real_T rtu_Then,
2027 ENUM_XBR_EBI_MODE_T rtu_Then_i, ENUM_XBR_PRIORITY_T rtu_Then_b,
2028 ENUM_XBR_CONTROL_MODE_T rtu_Then_f, ENUM_XBR_PASS_THROUGH_ACTIVE_T rtu_Then_bv,
2029 real_T rtu_Then_o, real_T rtu_Then_j, real_T rtu_Else, ENUM_XBR_EBI_MODE_T
2030 rtu_Else_g, ENUM_XBR_PRIORITY_T rtu_Else_h, ENUM_XBR_CONTROL_MODE_T rtu_Else_i,
2031 ENUM_XBR_PASS_THROUGH_ACTIVE_T rtu_Else_b, real_T rtu_Else_m, real_T
2032 rtu_Else_f, B_If_Then_Else_L4_MABX_b_T *localB)
2033{
2034 /* Switch: '<S1039>/Switch' */
2035 if (rtu_If) {
2036 localB->XBRExternalAccelDemand = rtu_Then;
2037 localB->XBREnduranceBrakeIntegrationMod = rtu_Then_i;
2038 localB->XBRPriority = rtu_Then_b;
2039 localB->XBRControlMode = rtu_Then_f;
2040 localB->XBRPassThroughActive = rtu_Then_bv;
2041 localB->XBRUrgency = rtu_Then_o;
2042 localB->XBRPassThroughEnabled = rtu_Then_j;
2043 } else {
2044 localB->XBRExternalAccelDemand = rtu_Else;
2045 localB->XBREnduranceBrakeIntegrationMod = rtu_Else_g;
2046 localB->XBRPriority = rtu_Else_h;
2047 localB->XBRControlMode = rtu_Else_i;
2048 localB->XBRPassThroughActive = rtu_Else_b;
2049 localB->XBRUrgency = rtu_Else_m;
2050 localB->XBRPassThroughEnabled = rtu_Else_f;
2051 }
2052
2053 /* End of Switch: '<S1039>/Switch' */
2054}
2055
2056static int32_T safe_cast_to_ENUM_XPR_CONTROL_M(int32_T input)
2057{
2058 int32_T y;
2059
2060 /* Initialize output value to default value for ENUM_XPR_CONTROL_MODE_T (NO_BRAKE_DEMAND) */
2061 y = 0;
2062 if (((input >= 0) && (input <= 3)) || ((input >= 13) && (input <= 15))) {
2063 /* Set output value to input value if it is a member of ENUM_XPR_CONTROL_MODE_T */
2064 y = input;
2065 }
2066
2067 return y;
2068}
2069
2070static int32_T safe_cast_to_ENUM_XPR_ERROR_STA(int32_T input)
2071{
2072 int32_T y;
2073
2074 /* Initialize output value to default value for ENUM_XPR_ERROR_STATE_T (XPR_OK) */
2075 y = 0;
2076 if ((input >= 0) && (input <= 3)) {
2077 /* Set output value to input value if it is a member of ENUM_XPR_ERROR_STATE_T */
2078 y = input;
2079 }
2080
2081 return y;
2082}
2083
2084/* Function for Chart: '<S211>/Relay_control_state_machine' */
2085static void L4_MABX_enter_atomic_INITIAL(void)
2086{
2087 /* Entry 'INITIAL': '<S218>:12' */
2088 L4_MABX_B.F_Ignition_relay_command_i = false;
2089 L4_MABX_B.F_Inverter_relay_command_p = false;
2090 L4_MABX_B.F_MABX_relay_command_n = false;
2091 L4_MABX_B.F_Sensor_relay_command_k = false;
2092 L4_MABX_DW.IGN_RELAY_ON_DELAY_SECS_APV =
2093 L4_MABX_B.TmpSignalConversionAtSFunctionI[0];
2094 L4_MABX_DW.INVERTER_RELAY_ON_DELAY_SECS_AP =
2095 L4_MABX_B.TmpSignalConversionAtSFunctionI[1];
2096 L4_MABX_DW.MABX_RELAY_ON_DELAY_SECS_APV =
2097 L4_MABX_B.TmpSignalConversionAtSFunctionI[2];
2098 L4_MABX_DW.SENSOR_RELAY_ON_DELAY_SECS_APV =
2099 L4_MABX_B.TmpSignalConversionAtSFunctionI[3];
2100 L4_MABX_DW.IGN_RELAY_OFF_DELAY_SECS_APV =
2101 L4_MABX_B.TmpSignalConversionAtSFunctio_k[0];
2102 L4_MABX_DW.INVERTER_RELAY_OFF_DELAY_SECS_A =
2103 L4_MABX_B.TmpSignalConversionAtSFunctio_k[1];
2104 L4_MABX_DW.MABX_RELAY_OFF_DELAY_SECS_APV =
2105 L4_MABX_B.TmpSignalConversionAtSFunctio_k[2];
2106 L4_MABX_DW.SENSOR_RELAY_OFF_DELAY_SECS_APV =
2107 L4_MABX_B.TmpSignalConversionAtSFunctio_k[3];
2108}
2109
2110real_T rt_atan2d_snf(real_T u0, real_T u1)
2111{
2112 real_T y;
2113 int32_T tmp;
2114 int32_T tmp_0;
2115 if (rtIsNaN(u0) || rtIsNaN(u1)) {
2116 y = (rtNaN);
2117 } else if (rtIsInf(u0) && rtIsInf(u1)) {
2118 if (u1 > 0.0) {
2119 tmp = 1;
2120 } else {
2121 tmp = -1;
2122 }
2123
2124 if (u0 > 0.0) {
2125 tmp_0 = 1;
2126 } else {
2127 tmp_0 = -1;
2128 }
2129
2130 y = atan2(tmp_0, tmp);
2131 } else if (u1 == 0.0) {
2132 if (u0 > 0.0) {
2133 y = RT_PI / 2.0;
2134 } else if (u0 < 0.0) {
2135 y = -(RT_PI / 2.0);
2136 } else {
2137 y = 0.0;
2138 }
2139 } else {
2140 y = atan2(u0, u1);
2141 }
2142
2143 return y;
2144}
2145
2146real_T rt_powd_snf(real_T u0, real_T u1)
2147{
2148 real_T y;
2149 real_T tmp;
2150 real_T tmp_0;
2151 if (rtIsNaN(u0) || rtIsNaN(u1)) {
2152 y = (rtNaN);
2153 } else {
2154 tmp = fabs(u0);
2155 tmp_0 = fabs(u1);
2156 if (rtIsInf(u1)) {
2157 if (tmp == 1.0) {
2158 y = 1.0;
2159 } else if (tmp > 1.0) {
2160 if (u1 > 0.0) {
2161 y = (rtInf);
2162 } else {
2163 y = 0.0;
2164 }
2165 } else if (u1 > 0.0) {
2166 y = 0.0;
2167 } else {
2168 y = (rtInf);
2169 }
2170 } else if (tmp_0 == 0.0) {
2171 y = 1.0;
2172 } else if (tmp_0 == 1.0) {
2173 if (u1 > 0.0) {
2174 y = u0;
2175 } else {
2176 y = 1.0 / u0;
2177 }
2178 } else if (u1 == 2.0) {
2179 y = u0 * u0;
2180 } else if ((u1 == 0.5) && (u0 >= 0.0)) {
2181 y = sqrt(u0);
2182 } else if ((u0 < 0.0) && (u1 > floor(u1))) {
2183 y = (rtNaN);
2184 } else {
2185 y = pow(u0, u1);
2186 }
2187 }
2188
2189 return y;
2190}
2191
2192/* Function for Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */
2193static void L4_MABX_Calculate_abc(void)
2194{
2195 /* MATLAB Function 'Calculate_abc': '<S359>:158' */
2196 /* Graphical Function 'Calculate_abc': '<S359>:158' */
2197 /* '<S359>:160:1' */
2198 L4_MABX_DW.a = L4_MABX_DW.Jerk56 - L4_MABX_DW.Jerk12;
2199
2200 /* '<S359>:160:1' */
2201 L4_MABX_DW.b = ((L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.Jerk12 -
2202 L4_MABX_DW.AccelerationInitialLimited * L4_MABX_DW.Jerk56) -
2203 L4_MABX_DW.Jerk12 * L4_MABX_DW.Jerk56 * L4_MABX_DW.TimeFinal) *
2204 2.0;
2205
2206 /* '<S359>:160:3' */
2207 L4_MABX_DW.c = (2.0 * L4_MABX_DW.Jerk12 * L4_MABX_DW.Jerk56 *
2208 (L4_MABX_DW.VelocityFinalLimited -
2209 L4_MABX_DW.VelocityInitialLimited) +
2210 L4_MABX_DW.AccelerationInitialLimited *
2211 L4_MABX_DW.AccelerationInitialLimited * L4_MABX_DW.Jerk56) -
2212 L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.AccelerationFinalLimited *
2213 L4_MABX_DW.Jerk12;
2214}
2215
2216/* Function for Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */
2217static void L4_MABX_CalculateAlternate_abc(void)
2218{
2219 /* MATLAB Function 'CalculateAlternate_abc': '<S359>:286' */
2220 /* Graphical Function 'CalculateAlternate_abc': '<S359>:286' */
2221 /* '<S359>:285:1' */
2222 L4_MABX_DW.a = 1.0;
2223
2224 /* '<S359>:285:1' */
2225 L4_MABX_DW.b = ((L4_MABX_DW.TimeFinal - 0.005) * L4_MABX_DW.Jerk56 -
2226 L4_MABX_DW.AccelerationFinalLimited) * 2.0;
2227
2228 /* '<S359>:285:3' */
2229 L4_MABX_DW.c = 2.0 * L4_MABX_DW.Jerk56 * (L4_MABX_DW.VelocityInitialLimited -
2230 L4_MABX_DW.VelocityFinalLimited) + L4_MABX_DW.AccelerationFinalLimited *
2231 L4_MABX_DW.AccelerationFinalLimited;
2232}
2233
2234/* Function for Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */
2235static void L4_MABX_CalculateAcceleration34(void)
2236{
2237 real_T u;
2238 real_T u0;
2239 real_T u1;
2240
2241 /* MATLAB Function 'CalculateAcceleration34': '<S359>:167' */
2242 /* Graphical Function 'CalculateAcceleration34': '<S359>:167' */
2243 /* '<S359>:186:1' */
2244 /* '<S359>:186:5' */
2245 /* '<S359>:186:8' */
2246 u = L4_MABX_DW.Jerk12;
2247 if (u < 0.0) {
2248 u = -1.0;
2249 } else if (u > 0.0) {
2250 u = 1.0;
2251 } else if (u == 0.0) {
2252 u = 0.0;
2253 } else {
2254 u = (rtNaN);
2255 }
2256
2257 u0 = fabs(L4_MABX_DW.Jerk12);
2258 u1 = fabs(((((L4_MABX_DW.AccelerationInitialLimited *
2259 L4_MABX_DW.AccelerationFinalLimited -
2260 L4_MABX_DW.AccelerationInitialLimited * L4_MABX_DW.Jerk56 *
2261 L4_MABX_DW.TimeFinal) + (L4_MABX_DW.VelocityFinalLimited -
2262 L4_MABX_DW.VelocityInitialLimited) * L4_MABX_DW.Jerk56) * 2.0 -
2263 L4_MABX_DW.AccelerationInitialLimited *
2264 L4_MABX_DW.AccelerationInitialLimited) -
2265 L4_MABX_DW.AccelerationFinalLimited *
2266 L4_MABX_DW.AccelerationFinalLimited) /
2267 (((L4_MABX_DW.VelocityFinalLimited -
2268 L4_MABX_DW.VelocityInitialLimited) -
2269 L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.TimeFinal) * 2.0
2270 + L4_MABX_DW.TimeFinal * L4_MABX_DW.TimeFinal * L4_MABX_DW.Jerk56))
2271 + 0.001;
2272 if ((u0 > u1) || rtIsNaN(u1)) {
2273 u1 = u0;
2274 }
2275
2276 L4_MABX_DW.Jerk12 = u * u1;
2277
2278 /* '<S359>:186:11' */
2279 u1 = L4_MABX_DW.Jerk12;
2280 if ((10.0 < u1) || rtIsNaN(u1)) {
2281 u1 = 10.0;
2282 }
2283
2284 if ((-10.0 > u1) || rtIsNaN(u1)) {
2285 L4_MABX_DW.Jerk12 = -10.0;
2286 } else {
2287 L4_MABX_DW.Jerk12 = u1;
2288 }
2289
2290 /* '<S359>:186:11' */
2291 L4_MABX_Calculate_abc();
2292
2293 /* '<S359>:187:1' */
2294 if (fabs(L4_MABX_DW.a) < 0.01) {
2295 /* '<S359>:188:1' */
2296 L4_MABX_DW.Jerk12 = L4_MABX_DW.Jerk56;
2297
2298 /* '<S359>:188:1' */
2299 L4_MABX_Calculate_abc();
2300
2301 /* '<S359>:188:1' */
2302 L4_MABX_DW.Acceleration34 = -L4_MABX_DW.c / L4_MABX_DW.b;
2303
2304 /* '<S359>:188:2' */
2305 L4_MABX_DW.AlternateMethod = false;
2306 } else {
2307 /* '<S359>:224:1' */
2308 if (L4_MABX_DW.b * L4_MABX_DW.b <= 4.0 * L4_MABX_DW.a * L4_MABX_DW.c) {
2309 /* '<S359>:292:1' */
2310 L4_MABX_CalculateAlternate_abc();
2311
2312 /* '<S359>:292:1' */
2313 L4_MABX_DW.Acceleration34 = -L4_MABX_DW.b / (2.0 * L4_MABX_DW.a);
2314
2315 /* '<S359>:292:2' */
2316 L4_MABX_DW.AlternateMethod = true;
2317 } else {
2318 /* '<S359>:294:1' */
2319 L4_MABX_DW.Acceleration34 = (sqrt(L4_MABX_DW.b * L4_MABX_DW.b - 4.0 *
2320 L4_MABX_DW.a * L4_MABX_DW.c) + -L4_MABX_DW.b) / (2.0 * L4_MABX_DW.a);
2321
2322 /* '<S359>:294:2' */
2323 L4_MABX_DW.AlternateMethod = false;
2324 }
2325 }
2326}
2327
2328static int32_T safe_cast_to_ENUM_CAN_STATUS_DI(int32_T input)
2329{
2330 int32_T y;
2331
2332 /* Initialize output value to default value for ENUM_CAN_STATUS_DIAG_T (ACTIVE) */
2333 y = 0;
2334 if ((input >= 0) && (input <= 2)) {
2335 /* Set output value to input value if it is a member of ENUM_CAN_STATUS_DIAG_T */
2336 y = input;
2337 }
2338
2339 return y;
2340}
2341
2342/* Model output function for TID0 */
2343void L4_MABX_output0(void) /* Sample time: [0.01s, 0.0s] */
2344{
2345 int_T tid = 0;
2346 uint8_T starting_index;
2347 real_T AccelerationAverage;
2348 real_T DeltaTimeFinal;
2349 uint8_T j;
2350 real_T PositionFinalLimited;
2351 real_T Time56;
2352 real_T DeltaTime;
2353 uint32_T tmp;
2354 boolean_T zcEvent;
2355 int32_T i;
2356 uint32_T q0;
2357 uint16_T tmp_0;
2358 int8_T tmp_1;
2359
2360 /* Update the flag to indicate when data transfers from
2361 * Sample time: [0.01s, 0.0s] to Sample time: [0.02s, 0.0s] */
2362 L4_MABX_M->Timing.perTaskSampleHits[1] =
2363 (L4_MABX_M->Timing.RateInteraction.TID0_1 == 0);
2364 (L4_MABX_M->Timing.RateInteraction.TID0_1)++;
2365 if ((L4_MABX_M->Timing.RateInteraction.TID0_1) > 1) {
2366 L4_MABX_M->Timing.RateInteraction.TID0_1 = 0;
2367 }
2368
2369 /* Update the flag to indicate when data transfers from
2370 * Sample time: [0.01s, 0.0s] to Sample time: [0.05s, 0.0s] */
2371 L4_MABX_M->Timing.perTaskSampleHits[2] =
2372 (L4_MABX_M->Timing.RateInteraction.TID0_2 == 0);
2373 (L4_MABX_M->Timing.RateInteraction.TID0_2)++;
2374 if ((L4_MABX_M->Timing.RateInteraction.TID0_2) > 4) {
2375 L4_MABX_M->Timing.RateInteraction.TID0_2 = 0;
2376 }
2377
2378 /* Update the flag to indicate when data transfers from
2379 * Sample time: [0.01s, 0.0s] to Sample time: [0.1s, 0.0s] */
2380 L4_MABX_M->Timing.perTaskSampleHits[3] =
2381 (L4_MABX_M->Timing.RateInteraction.TID0_3 == 0);
2382 (L4_MABX_M->Timing.RateInteraction.TID0_3)++;
2383 if ((L4_MABX_M->Timing.RateInteraction.TID0_3) > 9) {
2384 L4_MABX_M->Timing.RateInteraction.TID0_3 = 0;
2385 }
2386
2387 /* Update the flag to indicate when data transfers from
2388 * Sample time: [0.01s, 0.0s] to Sample time: [1.0s, 0.0s] */
2389 L4_MABX_M->Timing.perTaskSampleHits[6] =
2390 (L4_MABX_M->Timing.RateInteraction.TID0_6 == 0);
2391 (L4_MABX_M->Timing.RateInteraction.TID0_6)++;
2392 if ((L4_MABX_M->Timing.RateInteraction.TID0_6) > 99) {
2393 L4_MABX_M->Timing.RateInteraction.TID0_6 = 0;
2394 }
2395
2396 /* Update the flag to indicate when data transfers from
2397 * Sample time: [0.01s, 0.0s] to Sample time: [5.0s, 0.0s] */
2398 L4_MABX_M->Timing.perTaskSampleHits[7] =
2399 (L4_MABX_M->Timing.RateInteraction.TID0_7 == 0);
2400 (L4_MABX_M->Timing.RateInteraction.TID0_7)++;
2401 if ((L4_MABX_M->Timing.RateInteraction.TID0_7) > 499) {
2402 L4_MABX_M->Timing.RateInteraction.TID0_7 = 0;
2403 }
2404
2405 /* Outputs for Enabled SubSystem: '<S497>/AIR1' incorporates:
2406 * EnablePort: '<S498>/Enable'
2407 */
2408 /* Constant: '<S425>/Constant' */
2409 if (L4_MABX_P.Constant_Value_pd) {
2410 /* S-Function (rti_commonblock): '<S498>/S-Function1' */
2411 /* This comment workarounds a code generation problem */
2412
2413 /* dSPACE RTICAN RX Message Block: "AIR1" Id:419343921 */
2414 {
2415 UInt32 *CAN_Msg;
2416 static dsfloat time_old = 0.0;
2417
2418 /* Read status and timestamp info (previous message) */
2419 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].timestamp !=
2420 time_old) {
2421 /* ... save timestamp info for the calculation of the RX status
2422 during the consecutive sample hit*/
2423 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].
2424 timestamp;
2425
2426 /* ... set the processed flag to one */
2427 L4_MABX_B.SFunction1_o9_n = 1.0;
2428 L4_MABX_B.SFunction1_o10_nt = (real_T)
2429 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].timestamp;
2430 L4_MABX_B.SFunction1_o11_jy = (real_T)
2431 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].deltatime;
2432 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEAE31].data;
2433
2434 /* Decode CAN message */
2435 {
2436 {
2437 rtican_Signal_t CAN_Sgn;
2438
2439 /* ...... "PneumaticSupplyPress" (0|8, standard signal, unsigned int, little endian) */
2440 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
2441 CAN_Sgn.UnsignedSgn &= 0x000000FF;
2442 L4_MABX_B.SFunction1_o1_p0 = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
2443
2444 /* ...... "ParkingAnd_orTrailerAirPress" (8|8, standard signal, unsigned int, little endian) */
2445 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
2446 CAN_Sgn.UnsignedSgn &= 0x000000FF;
2447 L4_MABX_B.SFunction1_o2_or = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
2448
2449 /* ...... "ServiceBrakeCircuit1AirPress" (16|8, standard signal, unsigned int, little endian) */
2450 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
2451 CAN_Sgn.UnsignedSgn &= 0x000000FF;
2452 L4_MABX_B.SFunction1_o3_cv = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
2453
2454 /* ...... "ServiceBrakeCircuit2AirPress" (24|8, standard signal, unsigned int, little endian) */
2455 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
2456 CAN_Sgn.UnsignedSgn &= 0x000000FF;
2457 L4_MABX_B.SFunction1_o4_gt = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
2458
2459 /* ...... "AuxEquipmentSupplyPress" (32|8, standard signal, unsigned int, little endian) */
2460 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
2461 CAN_Sgn.UnsignedSgn &= 0x000000FF;
2462 L4_MABX_B.SFunction1_o5_he = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
2463
2464 /* ...... "AirSuspensionSupplyPress" (40|8, standard signal, unsigned int, little endian) */
2465 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
2466 CAN_Sgn.UnsignedSgn &= 0x000000FF;
2467 L4_MABX_B.SFunction1_o6_hl = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
2468
2469 /* ...... "AirCompressorStatus" (48|2, standard signal, unsigned int, little endian) */
2470 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
2471 CAN_Sgn.UnsignedSgn &= 0x00000003;
2472 L4_MABX_B.SFunction1_o7_lu = ((real_T) CAN_Sgn.UnsignedSgn);
2473
2474 /* ...... "PowertrainCircuitAirSupplyPress" (56|8, standard signal, unsigned int, little endian) */
2475 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
2476 CAN_Sgn.UnsignedSgn &= 0x000000FF;
2477 L4_MABX_B.SFunction1_o8_oa = 8 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
2478 }
2479 }
2480 } else {
2481 /* set RX status to 0 because no new message has arrived */
2482 L4_MABX_B.SFunction1_o9_n = 0.0;
2483 }
2484 }
2485 }
2486
2487 /* End of Constant: '<S425>/Constant' */
2488 /* End of Outputs for SubSystem: '<S497>/AIR1' */
2489
2490 /* Outputs for Enabled SubSystem: '<S499>/AMB' incorporates:
2491 * EnablePort: '<S500>/Enable'
2492 */
2493 /* Constant: '<S426>/Constant' */
2494 if (L4_MABX_P.Constant_Value_pmp) {
2495 /* S-Function (rti_commonblock): '<S500>/S-Function1' */
2496 /* This comment workarounds a code generation problem */
2497
2498 /* dSPACE RTICAN RX Message Block: "AMB" Id:419362048 */
2499 {
2500 UInt32 *CAN_Msg;
2501 static dsfloat time_old = 0.0;
2502
2503 /* Read status and timestamp info (previous message) */
2504 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].timestamp !=
2505 time_old) {
2506 /* ... save timestamp info for the calculation of the RX status
2507 during the consecutive sample hit*/
2508 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].
2509 timestamp;
2510
2511 /* ... set the processed flag to one */
2512 L4_MABX_B.SFunction1_o6_e = 1.0;
2513 L4_MABX_B.SFunction1_o7_ie = (real_T)
2514 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].timestamp;
2515 L4_MABX_B.SFunction1_o8_fs = (real_T)
2516 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].deltatime;
2517 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF500].data;
2518
2519 /* Decode CAN message */
2520 {
2521 {
2522 rtican_Signal_t CAN_Sgn;
2523
2524 /* ...... "BarometricPress" (0|8, standard signal, unsigned int, little endian) */
2525 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
2526 CAN_Sgn.UnsignedSgn &= 0x000000FF;
2527 L4_MABX_B.SFunction1_o1_nb = 0.5 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
2528
2529 /* ...... "CabInteriorTemp" (8|16, standard signal, unsigned int, little endian) */
2530 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
2531 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
2532 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
2533 L4_MABX_B.SFunction1_o2_dg5 = -273 + ( 0.03125 * ( ((real_T)
2534 CAN_Sgn.UnsignedSgn) ) );
2535
2536 /* ...... "AmbientAirTemp" (24|16, standard signal, unsigned int, little endian) */
2537 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
2538 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
2539 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
2540 L4_MABX_B.SFunction1_o3_ip = -273 + ( 0.03125 * ( ((real_T)
2541 CAN_Sgn.UnsignedSgn) ) );
2542
2543 /* ...... "EngAirIntakeTemp" (40|8, standard signal, unsigned int, little endian) */
2544 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
2545 CAN_Sgn.UnsignedSgn &= 0x000000FF;
2546 L4_MABX_B.SFunction1_o4_ci = -40 + ( ((real_T) CAN_Sgn.UnsignedSgn) );
2547
2548 /* ...... "RoadSurfaceTemp" (48|16, standard signal, unsigned int, little endian) */
2549 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
2550 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7];
2551 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
2552 L4_MABX_B.SFunction1_o5_lo = -273 + ( 0.03125 * ( ((real_T)
2553 CAN_Sgn.UnsignedSgn) ) );
2554 }
2555 }
2556 } else {
2557 /* set RX status to 0 because no new message has arrived */
2558 L4_MABX_B.SFunction1_o6_e = 0.0;
2559 }
2560 }
2561 }
2562
2563 /* End of Constant: '<S426>/Constant' */
2564 /* End of Outputs for SubSystem: '<S499>/AMB' */
2565
2566 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_1000ms' */
2567
2568 /* RateTransition: '<S869>/TmpRTBAtAIR1Inport1' */
2569 if (L4_MABX_M->Timing.RateInteraction.TID0_6 == 1) {
2570 L4_MABX_B.PneumaticSupplyPress = L4_MABX_B.SFunction1_o1_p0;
2571 L4_MABX_B.ParkingAnd_orTrailerAirPress = L4_MABX_B.SFunction1_o2_or;
2572 L4_MABX_B.ServiceBrakeCircuit1AirPress = L4_MABX_B.SFunction1_o3_cv;
2573 L4_MABX_B.ServiceBrakeCircuit2AirPress = L4_MABX_B.SFunction1_o4_gt;
2574 L4_MABX_B.AuxEquipmentSupplyPress = L4_MABX_B.SFunction1_o5_he;
2575 L4_MABX_B.AirSuspensionSupplyPress = L4_MABX_B.SFunction1_o6_hl;
2576 L4_MABX_B.AirCompressorStatus = L4_MABX_B.SFunction1_o7_lu;
2577 L4_MABX_B.PowertrainCircuitAirSupplyPress = L4_MABX_B.SFunction1_o8_oa;
2578 L4_MABX_B.BarometricPress_h = L4_MABX_B.SFunction1_o1_nb;
2579 L4_MABX_B.CabInteriorTemp = L4_MABX_B.SFunction1_o2_dg5;
2580 L4_MABX_B.AmbientAirTemp_h = L4_MABX_B.SFunction1_o3_ip;
2581 L4_MABX_B.EngAirIntakeTemp = L4_MABX_B.SFunction1_o4_ci;
2582 L4_MABX_B.RoadSurfaceTemp = L4_MABX_B.SFunction1_o5_lo;
2583 }
2584
2585 /* End of Outputs for SubSystem: '<S849>/CAN_TX_1000ms' */
2586
2587 /* S-Function (rti_commonblock): '<S734>/S-Function1' */
2588 /* This comment workarounds a code generation problem */
2589
2590 /* DataTypeConversion: '<S416>/EStopSwActive' */
2591 L4_MABX_B.EStopSwActive = L4_MABX_B.SFunction1_i;
2592
2593 /* Logic: '<S416>/Logical Operator1' */
2594 EStop = !L4_MABX_B.EStopSwActive;
2595
2596 /* S-Function (rti_commonblock): '<S733>/S-Function1' */
2597 /* This comment workarounds a code generation problem */
2598
2599 /* S-Function (sfix_bitop): '<S843>/Operator' */
2600 L4_MABX_B.Operator_mx = (L4_MABX_B.SFunction1_c &&
2601 (L4_MABX_P.Operator_BitMask_ly != 0));
2602
2603 /* DataTypeConversion: '<S843>/DataType' */
2604 L4_MABX_B.DataType_ll = L4_MABX_B.Operator_mx;
2605
2606 /* Logic: '<S745>/Logical Operator' */
2607 L4_MABX_B.LogicalOperator = !L4_MABX_B.DataType_ll;
2608
2609 /* S-Function (rti_commonblock): '<S735>/S-Function1' */
2610 /* This comment workarounds a code generation problem */
2611
2612 /* S-Function (sfix_bitop): '<S844>/Operator' */
2613 L4_MABX_B.Operator_hd = (L4_MABX_B.SFunction1_g &&
2614 (L4_MABX_P.Operator_BitMask_do != 0));
2615
2616 /* DataTypeConversion: '<S844>/DataType' */
2617 L4_MABX_B.DataType_oe = L4_MABX_B.Operator_hd;
2618
2619 /* Logic: '<S745>/AND2' */
2620 L4_MABX_B.AND2 = (L4_MABX_B.LogicalOperator && L4_MABX_B.DataType_oe);
2621
2622 /* Chart: '<S845>/Chart' */
2623 /* Gateway: DIGITAL/Signal Check/RationalityCheck/Chart */
2624 /* During: DIGITAL/Signal Check/RationalityCheck/Chart */
2625 if (L4_MABX_DW.is_active_c5_SUB_ECU_L4_MABX_HW == 0U) {
2626 /* Entry: DIGITAL/Signal Check/RationalityCheck/Chart */
2627 L4_MABX_DW.is_active_c5_SUB_ECU_L4_MABX_HW = 1U;
2628
2629 /* Entry Internal: DIGITAL/Signal Check/RationalityCheck/Chart */
2630 /* Transition: '<S846>:6' */
2631 L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_init_o;
2632
2633 /* Entry 'init': '<S846>:1' */
2634 L4_MABX_B.DiagPassed = false;
2635 } else {
2636 switch (L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf) {
2637 case L4_MABX_IN_DiagPassed:
2638 /* During 'DiagPassed': '<S846>:4' */
2639 break;
2640
2641 case L4_MABX_IN_SwitchOff:
2642 /* During 'SwitchOff': '<S846>:2' */
2643 if (L4_MABX_B.AND2) {
2644 /* Transition: '<S846>:8' */
2645 L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_DiagPassed;
2646
2647 /* Entry 'DiagPassed': '<S846>:4' */
2648 L4_MABX_B.DiagPassed = true;
2649 }
2650 break;
2651
2652 case L4_MABX_IN_SwitchOn:
2653 /* During 'SwitchOn': '<S846>:3' */
2654 if (!L4_MABX_B.AND2) {
2655 /* Transition: '<S846>:9' */
2656 L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SwitchOff;
2657 }
2658 break;
2659
2660 default:
2661 /* During 'init': '<S846>:1' */
2662 if (!L4_MABX_B.AND2) {
2663 /* Transition: '<S846>:5' */
2664 L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SwitchOff;
2665 } else {
2666 /* Transition: '<S846>:7' */
2667 L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SwitchOn;
2668 }
2669 break;
2670 }
2671 }
2672
2673 /* End of Chart: '<S845>/Chart' */
2674
2675 /* Switch: '<S745>/Switch' incorporates:
2676 * Constant: '<S745>/OverrideOperatorEnableSW_Default'
2677 */
2678 if (L4_MABX_B.DiagPassed) {
2679 EnableSw = L4_MABX_B.AND2;
2680 } else {
2681 EnableSw = L4_MABX_P.OverrideOperatorEnableSW_Defaul;
2682 }
2683
2684 /* End of Switch: '<S745>/Switch' */
2685
2686 /* UnitDelay: '<S757>/Unit Delay' */
2687 L4_MABX_B.UnitDelay = L4_MABX_DW.UnitDelay_DSTATE;
2688
2689 /* S-Function (rti_commonblock): '<S736>/S-Function1' */
2690 /* This comment workarounds a code generation problem */
2691
2692 /* DataTypeConversion: '<S416>/StartPBActive' */
2693 L4_MABX_B.StartPBActive = L4_MABX_B.SFunction1_l;
2694
2695 /* Logic: '<S416>/Logical Operator' */
2696 L4_MABX_B.LogicalOperator_i = !L4_MABX_B.StartPBActive;
2697
2698 /* RelationalOperator: '<S759>/Compare' incorporates:
2699 * Constant: '<S759>/Constant'
2700 */
2701 L4_MABX_B.Compare = ((int32_T)L4_MABX_B.LogicalOperator_i > (int32_T)
2702 L4_MABX_P.Constant_Value_ow);
2703
2704 /* UnitDelay: '<S755>/Delay Input1' */
2705 L4_MABX_B.Uk1_j = L4_MABX_DW.DelayInput1_DSTATE_n;
2706
2707 /* RelationalOperator: '<S755>/FixPt Relational Operator' */
2708 L4_MABX_B.FixPtRelationalOperator = ((int32_T)L4_MABX_B.Compare > (int32_T)
2709 L4_MABX_B.Uk1_j);
2710
2711 /* UnitDelay: '<S756>/Unit Delay' */
2712 L4_MABX_B.UnitDelay_c = L4_MABX_DW.UnitDelay_DSTATE_m;
2713
2714 /* UnitDelay: '<S743>/Unit Delay' */
2715 L4_MABX_B.UnitDelay_n = L4_MABX_DW.UnitDelay_DSTATE_o;
2716
2717 /* RelationalOperator: '<S758>/Compare' incorporates:
2718 * Constant: '<S758>/Constant'
2719 */
2720 L4_MABX_B.Compare_j = ((int32_T)L4_MABX_B.UnitDelay_n <= (int32_T)
2721 L4_MABX_P.Constant_Value_oc);
2722
2723 /* UnitDelay: '<S754>/Delay Input1' */
2724 L4_MABX_B.Uk1_f = L4_MABX_DW.DelayInput1_DSTATE_p;
2725
2726 /* RelationalOperator: '<S754>/FixPt Relational Operator' */
2727 L4_MABX_B.FixPtRelationalOperator_h = ((int32_T)L4_MABX_B.Compare_j > (int32_T)
2728 L4_MABX_B.Uk1_f);
2729
2730 /* UnitDelay: '<S756>/Unit Delay1' */
2731 L4_MABX_B.UnitDelay1_c = L4_MABX_DW.UnitDelay1_DSTATE_kw;
2732
2733 /* Logic: '<S756>/OR1' */
2734 L4_MABX_B.OR1 = (L4_MABX_B.FixPtRelationalOperator_h || L4_MABX_B.UnitDelay1_c);
2735
2736 /* Switch: '<S756>/Switch' incorporates:
2737 * Constant: '<S756>/Constant0'
2738 */
2739 if (L4_MABX_B.OR1) {
2740 /* Sum: '<S756>/Sum' incorporates:
2741 * Constant: '<S756>/Constant1'
2742 */
2743 L4_MABX_B.Sum_k = L4_MABX_B.UnitDelay_c + L4_MABX_P.Constant1_Value_fo;
2744 L4_MABX_B.Switch = L4_MABX_B.Sum_k;
2745 } else {
2746 L4_MABX_B.Switch = L4_MABX_P.Constant0_Value_g;
2747 }
2748
2749 /* End of Switch: '<S756>/Switch' */
2750
2751 /* RelationalOperator: '<S760>/Compare' incorporates:
2752 * Constant: '<S760>/Constant'
2753 */
2754 L4_MABX_B.Compare_k = (L4_MABX_B.Switch > L4_MABX_P.Constant_Value_ao);
2755
2756 /* Gain: '<S756>/Gain' incorporates:
2757 * Constant: '<S416>/Constant3'
2758 */
2759 L4_MABX_B.Gain = L4_MABX_P.Gain_Gain_iy * L4_MABX_P.Constant3_Value_a;
2760
2761 /* RelationalOperator: '<S756>/LessThanOrEqual' */
2762 L4_MABX_B.LessThanOrEqual = (L4_MABX_B.Switch <= L4_MABX_B.Gain);
2763
2764 /* Logic: '<S756>/AND' */
2765 L4_MABX_B.AND = (L4_MABX_B.Compare_k && L4_MABX_B.LessThanOrEqual);
2766
2767 /* Logic: '<S743>/NOT' */
2768 L4_MABX_B.NOT = !L4_MABX_B.AND;
2769
2770 /* Logic: '<S743>/AND' */
2771 L4_MABX_B.AND_k = (L4_MABX_B.FixPtRelationalOperator && L4_MABX_B.NOT);
2772
2773 /* UnitDelay: '<S757>/Unit Delay1' */
2774 L4_MABX_B.UnitDelay1_d = L4_MABX_DW.UnitDelay1_DSTATE_b;
2775
2776 /* Logic: '<S757>/OR1' */
2777 L4_MABX_B.OR1_j = (L4_MABX_B.AND_k || L4_MABX_B.UnitDelay1_d);
2778
2779 /* Switch: '<S757>/Switch' incorporates:
2780 * Constant: '<S757>/Constant0'
2781 */
2782 if (L4_MABX_B.OR1_j) {
2783 /* Sum: '<S757>/Sum' incorporates:
2784 * Constant: '<S757>/Constant1'
2785 */
2786 L4_MABX_B.Sum = L4_MABX_B.UnitDelay + L4_MABX_P.Constant1_Value_eg;
2787 L4_MABX_B.Switch_e = L4_MABX_B.Sum;
2788 } else {
2789 L4_MABX_B.Switch_e = L4_MABX_P.Constant0_Value_h;
2790 }
2791
2792 /* End of Switch: '<S757>/Switch' */
2793
2794 /* RelationalOperator: '<S761>/Compare' incorporates:
2795 * Constant: '<S761>/Constant'
2796 */
2797 L4_MABX_B.Compare_o = (L4_MABX_B.Switch_e > L4_MABX_P.Constant_Value_m);
2798
2799 /* Gain: '<S757>/Gain' incorporates:
2800 * Constant: '<S416>/Constant2'
2801 */
2802 L4_MABX_B.Gain_p = L4_MABX_P.Gain_Gain_k * L4_MABX_P.Constant2_Value_d;
2803
2804 /* RelationalOperator: '<S757>/LessThanOrEqual' */
2805 L4_MABX_B.LessThanOrEqual_n = (L4_MABX_B.Switch_e <= L4_MABX_B.Gain_p);
2806
2807 /* Logic: '<S757>/AND' */
2808 L4_MABX_B.AND_p = (L4_MABX_B.Compare_o && L4_MABX_B.LessThanOrEqual_n);
2809
2810 /* Logic: '<S743>/AND2' */
2811 EngagePB = (L4_MABX_B.AND_p && L4_MABX_B.NOT);
2812
2813 /* S-Function (rti_commonblock): '<S738>/S-Function1' */
2814 /* This comment workarounds a code generation problem */
2815
2816 /* DataTypeConversion: '<S416>/StartPBActive1' */
2817 L4_MABX_B.StartPBActive1 = L4_MABX_B.SFunction1_n;
2818
2819 /* Logic: '<S416>/Logical Operator3' */
2820 BrakeSW = !L4_MABX_B.StartPBActive1;
2821
2822 /* S-Function (rti_commonblock): '<S740>/S-Function1' */
2823 /* This comment workarounds a code generation problem */
2824
2825 /* DataTypeConversion: '<S416>/Data Type Conversion2' */
2826 L4_MABX_B.Pedal_1_pwm_freq_raw_value = L4_MABX_B.SFunction1_o1;
2827
2828 /* RelationalOperator: '<S791>/min_relop' incorporates:
2829 * Constant: '<S763>/PWMAFreqRngMin'
2830 */
2831 L4_MABX_B.min_relop = (L4_MABX_P.PWMAFreqRngMin_Value <
2832 L4_MABX_B.Pedal_1_pwm_freq_raw_value);
2833
2834 /* RelationalOperator: '<S791>/max_relop' incorporates:
2835 * Constant: '<S763>/PWMAFreqRngMax'
2836 */
2837 L4_MABX_B.max_relop = (L4_MABX_B.Pedal_1_pwm_freq_raw_value <
2838 L4_MABX_P.PWMAFreqRngMax_Value);
2839
2840 /* Logic: '<S791>/conjunction' */
2841 L4_MABX_B.conjunction = (L4_MABX_B.min_relop && L4_MABX_B.max_relop);
2842
2843 /* UnitDelay: '<S796>/FixPt Unit Delay2' */
2844 L4_MABX_B.FixPtUnitDelay2 = L4_MABX_DW.FixPtUnitDelay2_DSTATE;
2845
2846 /* UnitDelay: '<S796>/FixPt Unit Delay1' */
2847 L4_MABX_B.Xold = L4_MABX_DW.FixPtUnitDelay1_DSTATE;
2848
2849 /* Switch: '<S796>/Init' incorporates:
2850 * Constant: '<S763>/PWMAFreqRngFaultLimMin'
2851 */
2852 if (L4_MABX_B.FixPtUnitDelay2 != 0) {
2853 L4_MABX_B.Init = L4_MABX_P.PWMAFreqRngFaultLimMin_Value;
2854 } else {
2855 L4_MABX_B.Init = L4_MABX_B.Xold;
2856 }
2857
2858 /* End of Switch: '<S796>/Init' */
2859
2860 /* Sum: '<S792>/FixPt Sum1' incorporates:
2861 * Constant: '<S792>/FixPt Constant'
2862 */
2863 L4_MABX_B.FixPtSum1 = L4_MABX_B.Init - L4_MABX_P.FixPtConstant_Value_c;
2864
2865 /* Sum: '<S795>/FixPt Sum1' incorporates:
2866 * Constant: '<S795>/FixPt Constant'
2867 */
2868 L4_MABX_B.FixPtSum1_n = L4_MABX_B.Init + L4_MABX_P.FixPtConstant_Value_cq;
2869
2870 /* Outputs for Atomic SubSystem: '<S779>/If_Then_Else3' */
2871 L4_MABX_If_Then_Else(L4_MABX_B.conjunction, L4_MABX_B.FixPtSum1,
2872 L4_MABX_B.FixPtSum1_n, &L4_MABX_B.If_Then_Else3_j);
2873
2874 /* End of Outputs for SubSystem: '<S779>/If_Then_Else3' */
2875
2876 /* RelationalOperator: '<S793>/Relational Operator1' incorporates:
2877 * Constant: '<S763>/PWMAFreqRngFaultLimMax'
2878 */
2879 L4_MABX_B.RelationalOperator1 = (L4_MABX_B.If_Then_Else3_j.Switch >=
2880 L4_MABX_P.PWMAFreqRngFaultLimMax_Value);
2881
2882 /* RelationalOperator: '<S793>/Relational Operator' incorporates:
2883 * Constant: '<S763>/PWMAFreqRngFaultLimMin'
2884 */
2885 L4_MABX_B.RelationalOperator = (L4_MABX_B.If_Then_Else3_j.Switch <=
2886 L4_MABX_P.PWMAFreqRngFaultLimMin_Value);
2887
2888 /* Outputs for Atomic SubSystem: '<S793>/If_Then_Else1' */
2889
2890 /* Constant: '<S763>/PWMAFreqRngFaultLimMin' */
2891 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator,
2892 L4_MABX_P.PWMAFreqRngFaultLimMin_Value,
2893 L4_MABX_B.If_Then_Else3_j.Switch,
2894 &L4_MABX_B.If_Then_Else1_f);
2895
2896 /* End of Outputs for SubSystem: '<S793>/If_Then_Else1' */
2897
2898 /* Outputs for Atomic SubSystem: '<S793>/If_Then_Else' */
2899
2900 /* Constant: '<S763>/PWMAFreqRngFaultLimMax' */
2901 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1,
2902 L4_MABX_P.PWMAFreqRngFaultLimMax_Value,
2903 L4_MABX_B.If_Then_Else1_f.Switch,
2904 &L4_MABX_B.If_Then_Else_i);
2905
2906 /* End of Outputs for SubSystem: '<S793>/If_Then_Else' */
2907
2908 /* RelationalOperator: '<S779>/Relational Operator9' incorporates:
2909 * Constant: '<S763>/PWMAFreqRngFaultLimMin'
2910 */
2911 L4_MABX_B.F_Fault_Soft = (L4_MABX_B.If_Then_Else_i.Switch !=
2912 L4_MABX_P.PWMAFreqRngFaultLimMin_Value);
2913
2914 /* Gain: '<S416>/Gain' */
2915 L4_MABX_B.Gain_g = L4_MABX_P.Gain_Gain_o * L4_MABX_B.SFunction1_o2;
2916
2917 /* DataTypeConversion: '<S416>/Data Type Conversion9' */
2918 L4_MABX_B.Pedal_1_pwm_dc_raw_value = L4_MABX_B.Gain_g;
2919
2920 /* RelationalOperator: '<S783>/min_relop' incorporates:
2921 * Constant: '<S763>/PWMADCRngMin'
2922 */
2923 L4_MABX_B.min_relop_k = (L4_MABX_P.PWMADCRngMin_Value <
2924 L4_MABX_B.Pedal_1_pwm_dc_raw_value);
2925
2926 /* RelationalOperator: '<S783>/max_relop' incorporates:
2927 * Constant: '<S763>/PWMADCRngMax'
2928 */
2929 L4_MABX_B.max_relop_k = (L4_MABX_B.Pedal_1_pwm_dc_raw_value <
2930 L4_MABX_P.PWMADCRngMax_Value);
2931
2932 /* Logic: '<S783>/conjunction' */
2933 L4_MABX_B.conjunction_l = (L4_MABX_B.min_relop_k && L4_MABX_B.max_relop_k);
2934
2935 /* UnitDelay: '<S788>/FixPt Unit Delay2' */
2936 L4_MABX_B.FixPtUnitDelay2_h = L4_MABX_DW.FixPtUnitDelay2_DSTATE_i;
2937
2938 /* UnitDelay: '<S788>/FixPt Unit Delay1' */
2939 L4_MABX_B.Xold_g = L4_MABX_DW.FixPtUnitDelay1_DSTATE_p;
2940
2941 /* Switch: '<S788>/Init' incorporates:
2942 * Constant: '<S763>/PWMADCRngFaultLimMin'
2943 */
2944 if (L4_MABX_B.FixPtUnitDelay2_h != 0) {
2945 L4_MABX_B.Init_h = L4_MABX_P.PWMADCRngFaultLimMin_Value;
2946 } else {
2947 L4_MABX_B.Init_h = L4_MABX_B.Xold_g;
2948 }
2949
2950 /* End of Switch: '<S788>/Init' */
2951
2952 /* Sum: '<S784>/FixPt Sum1' incorporates:
2953 * Constant: '<S784>/FixPt Constant'
2954 */
2955 L4_MABX_B.FixPtSum1_o = L4_MABX_B.Init_h - L4_MABX_P.FixPtConstant_Value_b;
2956
2957 /* Sum: '<S787>/FixPt Sum1' incorporates:
2958 * Constant: '<S787>/FixPt Constant'
2959 */
2960 L4_MABX_B.FixPtSum1_b = L4_MABX_B.Init_h + L4_MABX_P.FixPtConstant_Value_g;
2961
2962 /* Outputs for Atomic SubSystem: '<S778>/If_Then_Else3' */
2963 L4_MABX_If_Then_Else(L4_MABX_B.conjunction_l, L4_MABX_B.FixPtSum1_o,
2964 L4_MABX_B.FixPtSum1_b, &L4_MABX_B.If_Then_Else3);
2965
2966 /* End of Outputs for SubSystem: '<S778>/If_Then_Else3' */
2967
2968 /* RelationalOperator: '<S785>/Relational Operator1' incorporates:
2969 * Constant: '<S763>/PWMADCRngFaultLimMax'
2970 */
2971 L4_MABX_B.RelationalOperator1_g = (L4_MABX_B.If_Then_Else3.Switch >=
2972 L4_MABX_P.PWMADCRngFaultLimMax_Value);
2973
2974 /* RelationalOperator: '<S785>/Relational Operator' incorporates:
2975 * Constant: '<S763>/PWMADCRngFaultLimMin'
2976 */
2977 L4_MABX_B.RelationalOperator_c = (L4_MABX_B.If_Then_Else3.Switch <=
2978 L4_MABX_P.PWMADCRngFaultLimMin_Value);
2979
2980 /* Outputs for Atomic SubSystem: '<S785>/If_Then_Else1' */
2981
2982 /* Constant: '<S763>/PWMADCRngFaultLimMin' */
2983 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_c,
2984 L4_MABX_P.PWMADCRngFaultLimMin_Value,
2985 L4_MABX_B.If_Then_Else3.Switch,
2986 &L4_MABX_B.If_Then_Else1_l);
2987
2988 /* End of Outputs for SubSystem: '<S785>/If_Then_Else1' */
2989
2990 /* Outputs for Atomic SubSystem: '<S785>/If_Then_Else' */
2991
2992 /* Constant: '<S763>/PWMADCRngFaultLimMax' */
2993 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_g,
2994 L4_MABX_P.PWMADCRngFaultLimMax_Value,
2995 L4_MABX_B.If_Then_Else1_l.Switch,
2996 &L4_MABX_B.If_Then_Else_c);
2997
2998 /* End of Outputs for SubSystem: '<S785>/If_Then_Else' */
2999
3000 /* RelationalOperator: '<S778>/Relational Operator9' incorporates:
3001 * Constant: '<S763>/PWMADCRngFaultLimMin'
3002 */
3003 L4_MABX_B.F_Fault_Soft_m = (L4_MABX_B.If_Then_Else_c.Switch !=
3004 L4_MABX_P.PWMADCRngFaultLimMin_Value);
3005
3006 /* Logic: '<S763>/Logical Operator2' */
3007 L4_MABX_B.LogicalOperator2 = (L4_MABX_B.F_Fault_Soft ||
3008 L4_MABX_B.F_Fault_Soft_m);
3009
3010 /* RelationalOperator: '<S779>/Relational Operator8' incorporates:
3011 * Constant: '<S763>/PWMAFreqRngFaultLimMax'
3012 */
3013 L4_MABX_B.F_Fault_Hard = (L4_MABX_P.PWMAFreqRngFaultLimMax_Value <=
3014 L4_MABX_B.If_Then_Else_i.Switch);
3015
3016 /* RelationalOperator: '<S778>/Relational Operator8' incorporates:
3017 * Constant: '<S763>/PWMADCRngFaultLimMax'
3018 */
3019 L4_MABX_B.F_Fault_Hard_n = (L4_MABX_P.PWMADCRngFaultLimMax_Value <=
3020 L4_MABX_B.If_Then_Else_c.Switch);
3021
3022 /* Logic: '<S763>/Logical Operator1' */
3023 L4_MABX_B.LogicalOperator1 = (L4_MABX_B.F_Fault_Hard ||
3024 L4_MABX_B.F_Fault_Hard_n);
3025
3026 /* Chart: '<S763>/Health State Machine PWM Sensor 1' */
3027 /* Gateway: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */
3028 /* During: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */
3029 if (L4_MABX_DW.is_active_c9_SUB_ECU_L4_MABX_HW == 0U) {
3030 /* Entry: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */
3031 L4_MABX_DW.is_active_c9_SUB_ECU_L4_MABX_HW = 1U;
3032
3033 /* Entry Internal: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 1 */
3034 /* Transition: '<S776>:2' */
3035 L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_FAILURE;
3036
3037 /* Entry 'NO_FAILURE': '<S776>:1' */
3038 L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE;
3039 } else if (L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf ==
3040 L4_MABX_IN_FAILURE_DETECTED) {
3041 /* During 'FAILURE_DETECTED': '<S776>:6' */
3042 if (L4_MABX_DW.is_FAILURE_DETECTED_p == L4_MABX_IN_ERROR) {
3043 L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE;
3044
3045 /* During 'ERROR': '<S776>:8' */
3046 if (!L4_MABX_B.LogicalOperator1) {
3047 /* Transition: '<S776>:17' */
3048 L4_MABX_DW.is_FAILURE_DETECTED_p = L4_MABX_IN_PENDING;
3049
3050 /* Entry 'PENDING': '<S776>:7' */
3051 L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING;
3052 }
3053 } else {
3054 L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING;
3055
3056 /* During 'PENDING': '<S776>:7' */
3057 zcEvent = ((!L4_MABX_B.LogicalOperator2) && (!L4_MABX_B.LogicalOperator1));
3058 if (zcEvent) {
3059 /* Transition: '<S776>:9' */
3060 L4_MABX_DW.is_FAILURE_DETECTED_p = L4_MABX_IN_NO_ACTIVE_CHILD;
3061 L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_FAILURE;
3062
3063 /* Entry 'NO_FAILURE': '<S776>:1' */
3064 L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE;
3065 } else {
3066 if (L4_MABX_B.LogicalOperator1) {
3067 /* Transition: '<S776>:12' */
3068 L4_MABX_DW.is_FAILURE_DETECTED_p = L4_MABX_IN_ERROR;
3069
3070 /* Entry 'ERROR': '<S776>:8' */
3071 L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE;
3072 }
3073 }
3074 }
3075 } else {
3076 L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE;
3077
3078 /* During 'NO_FAILURE': '<S776>:1' */
3079 zcEvent = (L4_MABX_B.LogicalOperator2 || L4_MABX_B.LogicalOperator1);
3080 if (zcEvent) {
3081 /* Transition: '<S776>:10' */
3082 L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_FAILURE_DETECTED;
3083
3084 /* Entry 'FAILURE_DETECTED': '<S776>:6' */
3085 /* Entry Internal 'FAILURE_DETECTED': '<S776>:6' */
3086 /* Transition: '<S776>:11' */
3087 L4_MABX_DW.is_FAILURE_DETECTED_p = L4_MABX_IN_PENDING;
3088
3089 /* Entry 'PENDING': '<S776>:7' */
3090 L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING;
3091 }
3092 }
3093
3094 /* End of Chart: '<S763>/Health State Machine PWM Sensor 1' */
3095
3096 /* RelationalOperator: '<S774>/Compare' incorporates:
3097 * Constant: '<S774>/Constant'
3098 */
3099 L4_MABX_B.Compare_i = (L4_MABX_B.Pedal_1_pwm_health_state ==
3100 L4_MABX_P.CompareToConstant_const_cw);
3101
3102 /* S-Function (rti_commonblock): '<S741>/S-Function1' */
3103 /* This comment workarounds a code generation problem */
3104
3105 /* DataTypeConversion: '<S416>/Data Type Conversion3' */
3106 L4_MABX_B.Pedal_2_pwm_freq_raw_value = L4_MABX_B.SFunction1_o1_g;
3107
3108 /* RelationalOperator: '<S807>/min_relop' incorporates:
3109 * Constant: '<S763>/PWMBFreqRngMin1'
3110 */
3111 L4_MABX_B.min_relop_a = (L4_MABX_P.PWMBFreqRngMin1_Value <
3112 L4_MABX_B.Pedal_2_pwm_freq_raw_value);
3113
3114 /* RelationalOperator: '<S807>/max_relop' incorporates:
3115 * Constant: '<S763>/PWMBFreqRngMax1'
3116 */
3117 L4_MABX_B.max_relop_l = (L4_MABX_B.Pedal_2_pwm_freq_raw_value <
3118 L4_MABX_P.PWMBFreqRngMax1_Value);
3119
3120 /* Logic: '<S807>/conjunction' */
3121 L4_MABX_B.conjunction_m = (L4_MABX_B.min_relop_a && L4_MABX_B.max_relop_l);
3122
3123 /* UnitDelay: '<S812>/FixPt Unit Delay2' */
3124 L4_MABX_B.FixPtUnitDelay2_p = L4_MABX_DW.FixPtUnitDelay2_DSTATE_o;
3125
3126 /* UnitDelay: '<S812>/FixPt Unit Delay1' */
3127 L4_MABX_B.Xold_m = L4_MABX_DW.FixPtUnitDelay1_DSTATE_h;
3128
3129 /* Switch: '<S812>/Init' incorporates:
3130 * Constant: '<S763>/PWMBFreqRngFaultLimMin1'
3131 */
3132 if (L4_MABX_B.FixPtUnitDelay2_p != 0) {
3133 L4_MABX_B.Init_d = L4_MABX_P.PWMBFreqRngFaultLimMin1_Value;
3134 } else {
3135 L4_MABX_B.Init_d = L4_MABX_B.Xold_m;
3136 }
3137
3138 /* End of Switch: '<S812>/Init' */
3139
3140 /* Sum: '<S808>/FixPt Sum1' incorporates:
3141 * Constant: '<S808>/FixPt Constant'
3142 */
3143 L4_MABX_B.FixPtSum1_e = L4_MABX_B.Init_d - L4_MABX_P.FixPtConstant_Value_f;
3144
3145 /* Sum: '<S811>/FixPt Sum1' incorporates:
3146 * Constant: '<S811>/FixPt Constant'
3147 */
3148 L4_MABX_B.FixPtSum1_c = L4_MABX_B.Init_d + L4_MABX_P.FixPtConstant_Value_p;
3149
3150 /* Outputs for Atomic SubSystem: '<S781>/If_Then_Else3' */
3151 L4_MABX_If_Then_Else(L4_MABX_B.conjunction_m, L4_MABX_B.FixPtSum1_e,
3152 L4_MABX_B.FixPtSum1_c, &L4_MABX_B.If_Then_Else3_l);
3153
3154 /* End of Outputs for SubSystem: '<S781>/If_Then_Else3' */
3155
3156 /* RelationalOperator: '<S809>/Relational Operator1' incorporates:
3157 * Constant: '<S763>/PWMBFreqRngFaultLimMax1'
3158 */
3159 L4_MABX_B.RelationalOperator1_gh = (L4_MABX_B.If_Then_Else3_l.Switch >=
3160 L4_MABX_P.PWMBFreqRngFaultLimMax1_Value);
3161
3162 /* RelationalOperator: '<S809>/Relational Operator' incorporates:
3163 * Constant: '<S763>/PWMBFreqRngFaultLimMin1'
3164 */
3165 L4_MABX_B.RelationalOperator_p = (L4_MABX_B.If_Then_Else3_l.Switch <=
3166 L4_MABX_P.PWMBFreqRngFaultLimMin1_Value);
3167
3168 /* Outputs for Atomic SubSystem: '<S809>/If_Then_Else1' */
3169
3170 /* Constant: '<S763>/PWMBFreqRngFaultLimMin1' */
3171 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_p,
3172 L4_MABX_P.PWMBFreqRngFaultLimMin1_Value,
3173 L4_MABX_B.If_Then_Else3_l.Switch,
3174 &L4_MABX_B.If_Then_Else1_c);
3175
3176 /* End of Outputs for SubSystem: '<S809>/If_Then_Else1' */
3177
3178 /* Outputs for Atomic SubSystem: '<S809>/If_Then_Else' */
3179
3180 /* Constant: '<S763>/PWMBFreqRngFaultLimMax1' */
3181 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_gh,
3182 L4_MABX_P.PWMBFreqRngFaultLimMax1_Value,
3183 L4_MABX_B.If_Then_Else1_c.Switch,
3184 &L4_MABX_B.If_Then_Else_g);
3185
3186 /* End of Outputs for SubSystem: '<S809>/If_Then_Else' */
3187
3188 /* RelationalOperator: '<S781>/Relational Operator9' incorporates:
3189 * Constant: '<S763>/PWMBFreqRngFaultLimMin1'
3190 */
3191 L4_MABX_B.F_Fault_Soft_j = (L4_MABX_B.If_Then_Else_g.Switch !=
3192 L4_MABX_P.PWMBFreqRngFaultLimMin1_Value);
3193
3194 /* Gain: '<S416>/Gain1' */
3195 L4_MABX_B.Gain1 = L4_MABX_P.Gain1_Gain_d * L4_MABX_B.SFunction1_o2_j;
3196
3197 /* DataTypeConversion: '<S416>/Data Type Conversion1' */
3198 L4_MABX_B.Pedal_2_pwm_dc_raw_value = L4_MABX_B.Gain1;
3199
3200 /* RelationalOperator: '<S799>/min_relop' incorporates:
3201 * Constant: '<S763>/PWMBDCRngMin1'
3202 */
3203 L4_MABX_B.min_relop_l = (L4_MABX_P.PWMBDCRngMin1_Value <
3204 L4_MABX_B.Pedal_2_pwm_dc_raw_value);
3205
3206 /* RelationalOperator: '<S799>/max_relop' incorporates:
3207 * Constant: '<S763>/PWMBDCRngMax1'
3208 */
3209 L4_MABX_B.max_relop_lf = (L4_MABX_B.Pedal_2_pwm_dc_raw_value <
3210 L4_MABX_P.PWMBDCRngMax1_Value);
3211
3212 /* Logic: '<S799>/conjunction' */
3213 L4_MABX_B.conjunction_g = (L4_MABX_B.min_relop_l && L4_MABX_B.max_relop_lf);
3214
3215 /* UnitDelay: '<S804>/FixPt Unit Delay2' */
3216 L4_MABX_B.FixPtUnitDelay2_e = L4_MABX_DW.FixPtUnitDelay2_DSTATE_k;
3217
3218 /* UnitDelay: '<S804>/FixPt Unit Delay1' */
3219 L4_MABX_B.Xold_e = L4_MABX_DW.FixPtUnitDelay1_DSTATE_h3;
3220
3221 /* Switch: '<S804>/Init' incorporates:
3222 * Constant: '<S763>/PWMBDCRngFaultLimMin1'
3223 */
3224 if (L4_MABX_B.FixPtUnitDelay2_e != 0) {
3225 L4_MABX_B.Init_l = L4_MABX_P.PWMBDCRngFaultLimMin1_Value;
3226 } else {
3227 L4_MABX_B.Init_l = L4_MABX_B.Xold_e;
3228 }
3229
3230 /* End of Switch: '<S804>/Init' */
3231
3232 /* Sum: '<S800>/FixPt Sum1' incorporates:
3233 * Constant: '<S800>/FixPt Constant'
3234 */
3235 L4_MABX_B.FixPtSum1_d = L4_MABX_B.Init_l - L4_MABX_P.FixPtConstant_Value_by;
3236
3237 /* Sum: '<S803>/FixPt Sum1' incorporates:
3238 * Constant: '<S803>/FixPt Constant'
3239 */
3240 L4_MABX_B.FixPtSum1_bg = L4_MABX_B.Init_l + L4_MABX_P.FixPtConstant_Value_l;
3241
3242 /* Outputs for Atomic SubSystem: '<S780>/If_Then_Else3' */
3243 L4_MABX_If_Then_Else(L4_MABX_B.conjunction_g, L4_MABX_B.FixPtSum1_d,
3244 L4_MABX_B.FixPtSum1_bg, &L4_MABX_B.If_Then_Else3_f);
3245
3246 /* End of Outputs for SubSystem: '<S780>/If_Then_Else3' */
3247
3248 /* RelationalOperator: '<S801>/Relational Operator1' incorporates:
3249 * Constant: '<S763>/PWMBDCRngFaultLimMax1'
3250 */
3251 L4_MABX_B.RelationalOperator1_n = (L4_MABX_B.If_Then_Else3_f.Switch >=
3252 L4_MABX_P.PWMBDCRngFaultLimMax1_Value);
3253
3254 /* RelationalOperator: '<S801>/Relational Operator' incorporates:
3255 * Constant: '<S763>/PWMBDCRngFaultLimMin1'
3256 */
3257 L4_MABX_B.RelationalOperator_k = (L4_MABX_B.If_Then_Else3_f.Switch <=
3258 L4_MABX_P.PWMBDCRngFaultLimMin1_Value);
3259
3260 /* Outputs for Atomic SubSystem: '<S801>/If_Then_Else1' */
3261
3262 /* Constant: '<S763>/PWMBDCRngFaultLimMin1' */
3263 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_k,
3264 L4_MABX_P.PWMBDCRngFaultLimMin1_Value,
3265 L4_MABX_B.If_Then_Else3_f.Switch,
3266 &L4_MABX_B.If_Then_Else1_e);
3267
3268 /* End of Outputs for SubSystem: '<S801>/If_Then_Else1' */
3269
3270 /* Outputs for Atomic SubSystem: '<S801>/If_Then_Else' */
3271
3272 /* Constant: '<S763>/PWMBDCRngFaultLimMax1' */
3273 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_n,
3274 L4_MABX_P.PWMBDCRngFaultLimMax1_Value,
3275 L4_MABX_B.If_Then_Else1_e.Switch,
3276 &L4_MABX_B.If_Then_Else_m);
3277
3278 /* End of Outputs for SubSystem: '<S801>/If_Then_Else' */
3279
3280 /* RelationalOperator: '<S780>/Relational Operator9' incorporates:
3281 * Constant: '<S763>/PWMBDCRngFaultLimMin1'
3282 */
3283 L4_MABX_B.F_Fault_Soft_f = (L4_MABX_B.If_Then_Else_m.Switch !=
3284 L4_MABX_P.PWMBDCRngFaultLimMin1_Value);
3285
3286 /* Logic: '<S763>/Logical Operator4' */
3287 L4_MABX_B.LogicalOperator4 = (L4_MABX_B.F_Fault_Soft_j ||
3288 L4_MABX_B.F_Fault_Soft_f);
3289
3290 /* RelationalOperator: '<S781>/Relational Operator8' incorporates:
3291 * Constant: '<S763>/PWMBFreqRngFaultLimMax1'
3292 */
3293 L4_MABX_B.F_Fault_Hard_p = (L4_MABX_P.PWMBFreqRngFaultLimMax1_Value <=
3294 L4_MABX_B.If_Then_Else_g.Switch);
3295
3296 /* RelationalOperator: '<S780>/Relational Operator8' incorporates:
3297 * Constant: '<S763>/PWMBDCRngFaultLimMax1'
3298 */
3299 L4_MABX_B.F_Fault_Hard_j = (L4_MABX_P.PWMBDCRngFaultLimMax1_Value <=
3300 L4_MABX_B.If_Then_Else_m.Switch);
3301
3302 /* Logic: '<S763>/Logical Operator3' */
3303 L4_MABX_B.LogicalOperator3 = (L4_MABX_B.F_Fault_Hard_p ||
3304 L4_MABX_B.F_Fault_Hard_j);
3305
3306 /* Chart: '<S763>/Health State Machine PWM Sensor 2' */
3307 /* Gateway: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */
3308 /* During: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */
3309 if (L4_MABX_DW.is_active_c10_SUB_ECU_L4_MABX_H == 0U) {
3310 /* Entry: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */
3311 L4_MABX_DW.is_active_c10_SUB_ECU_L4_MABX_H = 1U;
3312
3313 /* Entry Internal: DIGITAL/PWM pedal input management/Diagnose pedal input signals/Health State Machine PWM Sensor 2 */
3314 /* Transition: '<S777>:2' */
3315 L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_NO_FAILURE;
3316
3317 /* Entry 'NO_FAILURE': '<S777>:1' */
3318 L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE;
3319 } else if (L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter ==
3320 L4_MABX_IN_FAILURE_DETECTED) {
3321 /* During 'FAILURE_DETECTED': '<S777>:6' */
3322 if (L4_MABX_DW.is_FAILURE_DETECTED == L4_MABX_IN_ERROR) {
3323 L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE;
3324
3325 /* During 'ERROR': '<S777>:8' */
3326 if (!L4_MABX_B.LogicalOperator3) {
3327 /* Transition: '<S777>:20' */
3328 L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_PENDING;
3329
3330 /* Entry 'PENDING': '<S777>:7' */
3331 L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING;
3332 }
3333 } else {
3334 L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING;
3335
3336 /* During 'PENDING': '<S777>:7' */
3337 zcEvent = ((!L4_MABX_B.LogicalOperator4) && (!L4_MABX_B.LogicalOperator3));
3338 if (zcEvent) {
3339 /* Transition: '<S777>:9' */
3340 L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_NO_ACTIVE_CHILD;
3341 L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_NO_FAILURE;
3342
3343 /* Entry 'NO_FAILURE': '<S777>:1' */
3344 L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE;
3345 } else {
3346 if (L4_MABX_B.LogicalOperator3) {
3347 /* Transition: '<S777>:12' */
3348 L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_ERROR;
3349
3350 /* Entry 'ERROR': '<S777>:8' */
3351 L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_ACTIVE;
3352 }
3353 }
3354 }
3355 } else {
3356 L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE;
3357
3358 /* During 'NO_FAILURE': '<S777>:1' */
3359 zcEvent = (L4_MABX_B.LogicalOperator4 || L4_MABX_B.LogicalOperator3);
3360 if (zcEvent) {
3361 /* Transition: '<S777>:10' */
3362 L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_FAILURE_DETECTED;
3363
3364 /* Entry 'FAILURE_DETECTED': '<S777>:6' */
3365 /* Entry Internal 'FAILURE_DETECTED': '<S777>:6' */
3366 /* Transition: '<S777>:11' */
3367 L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_PENDING;
3368
3369 /* Entry 'PENDING': '<S777>:7' */
3370 L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_PENDING;
3371 }
3372 }
3373
3374 /* End of Chart: '<S763>/Health State Machine PWM Sensor 2' */
3375
3376 /* RelationalOperator: '<S775>/Compare' incorporates:
3377 * Constant: '<S775>/Constant'
3378 */
3379 L4_MABX_B.Compare_b = (L4_MABX_B.Pedal_2_pwm_health_state ==
3380 L4_MABX_P.CompareToConstant2_const_c);
3381
3382 /* Logic: '<S763>/Logical Operator5' */
3383 L4_MABX_B.F_Pedal_pwm_sens_total_failure = (L4_MABX_B.Compare_i &&
3384 L4_MABX_B.Compare_b);
3385
3386 /* UnitDelay: '<S766>/Unit_Delay' */
3387 L4_MABX_B.Unit_Delay_kh = L4_MABX_DW.Unit_Delay_DSTATE_h2;
3388
3389 /* UnitDelay: '<S833>/Unit_Delay1' */
3390 L4_MABX_B.Unit_Delay1 = L4_MABX_DW.Unit_Delay1_DSTATE;
3391
3392 /* Logic: '<S833>/Logical Operator' */
3393 L4_MABX_B.LogicalOperator_n = (L4_MABX_B.Unit_Delay_kh ||
3394 L4_MABX_B.Unit_Delay1);
3395
3396 /* MinMax: '<S833>/MinMax1' incorporates:
3397 * Constant: '<S766>/PEDAL_PWM_SENSOR_DATA_APV.T1_CONST'
3398 * Constant: '<S766>/dT'
3399 */
3400 DeltaTime = L4_MABX_P.dT_Value;
3401 PositionFinalLimited = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVT1_CON;
3402 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
3403 PositionFinalLimited = DeltaTime;
3404 }
3405
3406 L4_MABX_B.MinMax1 = PositionFinalLimited;
3407
3408 /* End of MinMax: '<S833>/MinMax1' */
3409
3410 /* Saturate: '<S833>/Saturation' */
3411 DeltaTime = L4_MABX_B.MinMax1;
3412 Time56 = L4_MABX_P.Saturation_LowerSat_kl;
3413 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_j;
3414 if (DeltaTime > PositionFinalLimited) {
3415 L4_MABX_B.Saturation = PositionFinalLimited;
3416 } else if (DeltaTime < Time56) {
3417 L4_MABX_B.Saturation = Time56;
3418 } else {
3419 L4_MABX_B.Saturation = DeltaTime;
3420 }
3421
3422 /* End of Saturate: '<S833>/Saturation' */
3423
3424 /* Product: '<S833>/Divide' incorporates:
3425 * Constant: '<S766>/dT'
3426 */
3427 L4_MABX_B.Divide = L4_MABX_P.dT_Value / L4_MABX_B.Saturation;
3428
3429 /* Product: '<S833>/Product2' */
3430 L4_MABX_B.Product2 = L4_MABX_B.Pedal_1_pwm_dc_raw_value * L4_MABX_B.Divide;
3431
3432 /* Sum: '<S833>/Subtract1' incorporates:
3433 * Constant: '<S833>/Constant1'
3434 */
3435 L4_MABX_B.Subtract1 = L4_MABX_P.Constant1_Value_f3 - L4_MABX_B.Divide;
3436
3437 /* UnitDelay: '<S833>/Unit_Delay2' */
3438 L4_MABX_B.Unit_Delay2 = L4_MABX_DW.Unit_Delay2_DSTATE;
3439
3440 /* Product: '<S833>/Product1' */
3441 L4_MABX_B.Product1 = L4_MABX_B.Subtract1 * L4_MABX_B.Unit_Delay2;
3442
3443 /* Sum: '<S833>/Add1' */
3444 L4_MABX_B.Add1 = L4_MABX_B.Product2 + L4_MABX_B.Product1;
3445
3446 /* Outputs for Atomic SubSystem: '<S833>/If_Then_Else' */
3447 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_n,
3448 L4_MABX_B.Pedal_1_pwm_dc_raw_value, L4_MABX_B.Add1,
3449 &L4_MABX_B.If_Then_Else_mz);
3450
3451 /* End of Outputs for SubSystem: '<S833>/If_Then_Else' */
3452
3453 /* Lookup_n-D: '<S766>/PEDAL_PWM_ANGLE_SENS_1_MPV' */
3454 L4_MABX_B.Pedal_1_pwm_undefault = look1_binlcapw
3455 (L4_MABX_B.If_Then_Else_mz.Switch, L4_MABX_P.PEDAL_PWM_ANGLE_SENS_1_MPV_bp01,
3456 L4_MABX_P.PEDAL_PWM_ANGLE_SENS_1_MPV_tabl, 7U);
3457
3458 /* UnitDelay: '<S766>/Unit_Delay1' */
3459 L4_MABX_B.Unit_Delay1_m = L4_MABX_DW.Unit_Delay1_DSTATE_m;
3460
3461 /* UnitDelay: '<S834>/Unit_Delay1' */
3462 L4_MABX_B.Unit_Delay1_c = L4_MABX_DW.Unit_Delay1_DSTATE_j;
3463
3464 /* Logic: '<S834>/Logical Operator' */
3465 L4_MABX_B.LogicalOperator_k = (L4_MABX_B.Unit_Delay1_m ||
3466 L4_MABX_B.Unit_Delay1_c);
3467
3468 /* MinMax: '<S834>/MinMax1' incorporates:
3469 * Constant: '<S766>/PEDAL_PWM_SENSOR_DATA_APV.T2_CONST'
3470 * Constant: '<S766>/dT1'
3471 */
3472 DeltaTime = L4_MABX_P.dT1_Value;
3473 PositionFinalLimited = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVT2_CON;
3474 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
3475 PositionFinalLimited = DeltaTime;
3476 }
3477
3478 L4_MABX_B.MinMax1_h = PositionFinalLimited;
3479
3480 /* End of MinMax: '<S834>/MinMax1' */
3481
3482 /* Saturate: '<S834>/Saturation' */
3483 DeltaTime = L4_MABX_B.MinMax1_h;
3484 Time56 = L4_MABX_P.Saturation_LowerSat_kz;
3485 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_g;
3486 if (DeltaTime > PositionFinalLimited) {
3487 L4_MABX_B.Saturation_m = PositionFinalLimited;
3488 } else if (DeltaTime < Time56) {
3489 L4_MABX_B.Saturation_m = Time56;
3490 } else {
3491 L4_MABX_B.Saturation_m = DeltaTime;
3492 }
3493
3494 /* End of Saturate: '<S834>/Saturation' */
3495
3496 /* Product: '<S834>/Divide' incorporates:
3497 * Constant: '<S766>/dT1'
3498 */
3499 L4_MABX_B.Divide_h = L4_MABX_P.dT1_Value / L4_MABX_B.Saturation_m;
3500
3501 /* Product: '<S834>/Product2' */
3502 L4_MABX_B.Product2_b = L4_MABX_B.Pedal_2_pwm_freq_raw_value *
3503 L4_MABX_B.Divide_h;
3504
3505 /* Sum: '<S834>/Subtract1' incorporates:
3506 * Constant: '<S834>/Constant1'
3507 */
3508 L4_MABX_B.Subtract1_m = L4_MABX_P.Constant1_Value_ga - L4_MABX_B.Divide_h;
3509
3510 /* UnitDelay: '<S834>/Unit_Delay2' */
3511 L4_MABX_B.Unit_Delay2_p = L4_MABX_DW.Unit_Delay2_DSTATE_b;
3512
3513 /* Product: '<S834>/Product1' */
3514 L4_MABX_B.Product1_c = L4_MABX_B.Subtract1_m * L4_MABX_B.Unit_Delay2_p;
3515
3516 /* Sum: '<S834>/Add1' */
3517 L4_MABX_B.Add1_n = L4_MABX_B.Product2_b + L4_MABX_B.Product1_c;
3518
3519 /* Outputs for Atomic SubSystem: '<S834>/If_Then_Else' */
3520 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_k,
3521 L4_MABX_B.Pedal_2_pwm_freq_raw_value, L4_MABX_B.Add1_n,
3522 &L4_MABX_B.If_Then_Else_dt);
3523
3524 /* End of Outputs for SubSystem: '<S834>/If_Then_Else' */
3525
3526 /* Lookup_n-D: '<S766>/PEDAL_PWM_ANGLE_SENS_2_MPV' */
3527 L4_MABX_B.Pedal_2_pwm_undefault = look1_binlcapw
3528 (L4_MABX_B.If_Then_Else_dt.Switch, L4_MABX_P.PEDAL_PWM_ANGLE_SENS_2_MPV_bp01,
3529 L4_MABX_P.PEDAL_PWM_ANGLE_SENS_2_MPV_tabl, 7U);
3530
3531 /* Sum: '<S768>/Subtract' */
3532 L4_MABX_B.Subtract = L4_MABX_B.Pedal_1_pwm_undefault -
3533 L4_MABX_B.Pedal_2_pwm_undefault;
3534
3535 /* Abs: '<S768>/Abs' */
3536 L4_MABX_B.Abs = fabs(L4_MABX_B.Subtract);
3537
3538 /* RelationalOperator: '<S770>/Compare' incorporates:
3539 * Constant: '<S770>/Constant'
3540 */
3541 L4_MABX_B.Compare_d = (L4_MABX_B.Pedal_1_pwm_health_state ==
3542 L4_MABX_P.CompareToConstant3_const_c);
3543
3544 /* RelationalOperator: '<S826>/Compare' incorporates:
3545 * Constant: '<S826>/Constant'
3546 */
3547 L4_MABX_B.Compare_id = (L4_MABX_B.Pedal_2_pwm_health_state ==
3548 L4_MABX_P.CompareToConstant5_const);
3549
3550 /* Logic: '<S764>/Logical Operator7' */
3551 L4_MABX_B.LogicalOperator7 = !L4_MABX_B.Compare_id;
3552
3553 /* RelationalOperator: '<S825>/Compare' incorporates:
3554 * Constant: '<S825>/Constant'
3555 */
3556 L4_MABX_B.Compare_c = (L4_MABX_B.Pedal_2_pwm_health_state ==
3557 L4_MABX_P.CompareToConstant4_const);
3558
3559 /* Logic: '<S764>/Logical Operator8' */
3560 L4_MABX_B.LogicalOperator8 = !L4_MABX_B.Compare_c;
3561
3562 /* UnitDelay: '<S832>/FixPt Unit Delay2' */
3563 L4_MABX_B.FixPtUnitDelay2_ee = L4_MABX_DW.FixPtUnitDelay2_DSTATE_ie;
3564
3565 /* UnitDelay: '<S832>/FixPt Unit Delay1' */
3566 L4_MABX_B.Xold_h = L4_MABX_DW.FixPtUnitDelay1_DSTATE_o;
3567
3568 /* Switch: '<S832>/Init' incorporates:
3569 * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE'
3570 */
3571 if (L4_MABX_B.FixPtUnitDelay2_ee != 0) {
3572 L4_MABX_B.Init_c = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL;
3573 } else {
3574 L4_MABX_B.Init_c = L4_MABX_B.Xold_h;
3575 }
3576
3577 /* End of Switch: '<S832>/Init' */
3578
3579 /* Outputs for Atomic SubSystem: '<S764>/If_Then_Else3' */
3580 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator8,
3581 L4_MABX_B.Pedal_2_pwm_undefault, L4_MABX_B.Init_c,
3582 &L4_MABX_B.If_Then_Else3_i);
3583
3584 /* End of Outputs for SubSystem: '<S764>/If_Then_Else3' */
3585
3586 /* Outputs for Atomic SubSystem: '<S764>/If_Then_Else2' */
3587
3588 /* Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' */
3589 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator7,
3590 L4_MABX_B.If_Then_Else3_i.Switch,
3591 L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL,
3592 &L4_MABX_B.If_Then_Else2_p);
3593
3594 /* End of Outputs for SubSystem: '<S764>/If_Then_Else2' */
3595
3596 /* RelationalOperator: '<S824>/Compare' incorporates:
3597 * Constant: '<S824>/Constant'
3598 */
3599 L4_MABX_B.Compare_a = (L4_MABX_B.Pedal_1_pwm_health_state ==
3600 L4_MABX_P.CompareToConstant3_const_m);
3601
3602 /* Logic: '<S764>/Logical Operator5' */
3603 L4_MABX_B.LogicalOperator5 = !L4_MABX_B.Compare_a;
3604
3605 /* RelationalOperator: '<S823>/Compare' incorporates:
3606 * Constant: '<S823>/Constant'
3607 */
3608 L4_MABX_B.Compare_l = (L4_MABX_B.Pedal_1_pwm_health_state ==
3609 L4_MABX_P.CompareToConstant1_const_jn);
3610
3611 /* Logic: '<S764>/Logical Operator6' */
3612 L4_MABX_B.LogicalOperator6 = !L4_MABX_B.Compare_l;
3613
3614 /* UnitDelay: '<S831>/FixPt Unit Delay2' */
3615 L4_MABX_B.FixPtUnitDelay2_ej = L4_MABX_DW.FixPtUnitDelay2_DSTATE_iv;
3616
3617 /* UnitDelay: '<S831>/FixPt Unit Delay1' */
3618 L4_MABX_B.Xold_hz = L4_MABX_DW.FixPtUnitDelay1_DSTATE_i;
3619
3620 /* Switch: '<S831>/Init' incorporates:
3621 * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE'
3622 */
3623 if (L4_MABX_B.FixPtUnitDelay2_ej != 0) {
3624 L4_MABX_B.Init_j = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL;
3625 } else {
3626 L4_MABX_B.Init_j = L4_MABX_B.Xold_hz;
3627 }
3628
3629 /* End of Switch: '<S831>/Init' */
3630
3631 /* Outputs for Atomic SubSystem: '<S764>/If_Then_Else1' */
3632 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator6,
3633 L4_MABX_B.Pedal_1_pwm_undefault, L4_MABX_B.Init_j,
3634 &L4_MABX_B.If_Then_Else1_ln);
3635
3636 /* End of Outputs for SubSystem: '<S764>/If_Then_Else1' */
3637
3638 /* Outputs for Atomic SubSystem: '<S764>/If_Then_Else' */
3639
3640 /* Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' */
3641 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator5,
3642 L4_MABX_B.If_Then_Else1_ln.Switch,
3643 L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL,
3644 &L4_MABX_B.If_Then_Else_n);
3645
3646 /* End of Outputs for SubSystem: '<S764>/If_Then_Else' */
3647
3648 /* Outputs for Atomic SubSystem: '<S762>/If_Then_Else1' */
3649 L4_MABX_If_Then_Else(L4_MABX_B.Compare_d, L4_MABX_B.If_Then_Else2_p.Switch,
3650 L4_MABX_B.If_Then_Else_n.Switch, &L4_MABX_B.If_Then_Else1);
3651
3652 /* End of Outputs for SubSystem: '<S762>/If_Then_Else1' */
3653
3654 /* RelationalOperator: '<S769>/Compare' incorporates:
3655 * Constant: '<S769>/Constant'
3656 */
3657 L4_MABX_B.Compare_n = (L4_MABX_B.Pedal_2_pwm_health_state ==
3658 L4_MABX_P.CompareToConstant1_const_o);
3659
3660 /* Outputs for Atomic SubSystem: '<S762>/If_Then_Else2' */
3661 L4_MABX_If_Then_Else(L4_MABX_B.Compare_n, L4_MABX_B.If_Then_Else_n.Switch,
3662 L4_MABX_B.If_Then_Else2_p.Switch,
3663 &L4_MABX_B.If_Then_Else2);
3664
3665 /* End of Outputs for SubSystem: '<S762>/If_Then_Else2' */
3666
3667 /* MinMax: '<S762>/MinMax' */
3668 DeltaTime = L4_MABX_B.If_Then_Else1.Switch;
3669 PositionFinalLimited = L4_MABX_B.If_Then_Else2.Switch;
3670 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
3671 PositionFinalLimited = DeltaTime;
3672 }
3673
3674 L4_MABX_B.MinMax = PositionFinalLimited;
3675
3676 /* End of MinMax: '<S762>/MinMax' */
3677
3678 /* Outputs for Atomic SubSystem: '<S762>/If_Then_Else' */
3679
3680 /* Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE' */
3681 L4_MABX_If_Then_Else(L4_MABX_B.F_Pedal_pwm_sens_total_failure,
3682 L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL,
3683 L4_MABX_B.MinMax, &L4_MABX_B.If_Then_Else_e);
3684
3685 /* End of Outputs for SubSystem: '<S762>/If_Then_Else' */
3686
3687 /* Lookup_n-D: '<S768>/PEDAL_PWM_ANGLE_DEV_MPV' */
3688 L4_MABX_B.PEDAL_PWM_ANGLE_DEV_MPV = look1_binlcapw
3689 (L4_MABX_B.If_Then_Else_e.Switch, L4_MABX_P.PEDAL_PWM_ANGLE_DEV_MPV_bp01Dat,
3690 L4_MABX_P.PEDAL_PWM_ANGLE_DEV_MPV_tableDa, 7U);
3691
3692 /* RelationalOperator: '<S768>/Relational Operator' */
3693 L4_MABX_B.F_Pedal_pwm_sync_fault = (L4_MABX_B.Abs >
3694 L4_MABX_B.PEDAL_PWM_ANGLE_DEV_MPV);
3695
3696 /* DataTypeConversion: '<S763>/Data Type Conversion2' */
3697 L4_MABX_B.DataTypeConversion2 = L4_MABX_B.F_Pedal_pwm_sync_fault;
3698
3699 /* RelationalOperator: '<S815>/min_relop' incorporates:
3700 * Constant: '<S763>/PWMSynchRngMin'
3701 */
3702 L4_MABX_B.min_relop_lv = (L4_MABX_P.PWMSynchRngMin_Value <
3703 L4_MABX_B.DataTypeConversion2);
3704
3705 /* RelationalOperator: '<S815>/max_relop' incorporates:
3706 * Constant: '<S763>/PWMSynchRngMax'
3707 */
3708 L4_MABX_B.max_relop_ki = (L4_MABX_B.DataTypeConversion2 <
3709 L4_MABX_P.PWMSynchRngMax_Value);
3710
3711 /* Logic: '<S815>/conjunction' */
3712 L4_MABX_B.conjunction_b = (L4_MABX_B.min_relop_lv && L4_MABX_B.max_relop_ki);
3713
3714 /* UnitDelay: '<S820>/FixPt Unit Delay2' */
3715 L4_MABX_B.FixPtUnitDelay2_em = L4_MABX_DW.FixPtUnitDelay2_DSTATE_b;
3716
3717 /* UnitDelay: '<S820>/FixPt Unit Delay1' */
3718 L4_MABX_B.Xold_k = L4_MABX_DW.FixPtUnitDelay1_DSTATE_e;
3719
3720 /* Switch: '<S820>/Init' incorporates:
3721 * Constant: '<S763>/PWMSynchFaultLimMin'
3722 */
3723 if (L4_MABX_B.FixPtUnitDelay2_em != 0) {
3724 L4_MABX_B.Init_ck = L4_MABX_P.PWMSynchFaultLimMin_Value;
3725 } else {
3726 L4_MABX_B.Init_ck = L4_MABX_B.Xold_k;
3727 }
3728
3729 /* End of Switch: '<S820>/Init' */
3730
3731 /* Sum: '<S816>/FixPt Sum1' incorporates:
3732 * Constant: '<S816>/FixPt Constant'
3733 */
3734 L4_MABX_B.FixPtSum1_m = L4_MABX_B.Init_ck - L4_MABX_P.FixPtConstant_Value_fb;
3735
3736 /* Sum: '<S819>/FixPt Sum1' incorporates:
3737 * Constant: '<S819>/FixPt Constant'
3738 */
3739 L4_MABX_B.FixPtSum1_ex = L4_MABX_B.Init_ck + L4_MABX_P.FixPtConstant_Value_a;
3740
3741 /* Outputs for Atomic SubSystem: '<S782>/If_Then_Else3' */
3742 L4_MABX_If_Then_Else(L4_MABX_B.conjunction_b, L4_MABX_B.FixPtSum1_m,
3743 L4_MABX_B.FixPtSum1_ex, &L4_MABX_B.If_Then_Else3_m);
3744
3745 /* End of Outputs for SubSystem: '<S782>/If_Then_Else3' */
3746
3747 /* RelationalOperator: '<S817>/Relational Operator1' incorporates:
3748 * Constant: '<S763>/PWMSynchFaultLimMax'
3749 */
3750 L4_MABX_B.RelationalOperator1_h = (L4_MABX_B.If_Then_Else3_m.Switch >=
3751 L4_MABX_P.PWMSynchFaultLimMax_Value);
3752
3753 /* RelationalOperator: '<S817>/Relational Operator' incorporates:
3754 * Constant: '<S763>/PWMSynchFaultLimMin'
3755 */
3756 L4_MABX_B.RelationalOperator_e = (L4_MABX_B.If_Then_Else3_m.Switch <=
3757 L4_MABX_P.PWMSynchFaultLimMin_Value);
3758
3759 /* Outputs for Atomic SubSystem: '<S817>/If_Then_Else1' */
3760
3761 /* Constant: '<S763>/PWMSynchFaultLimMin' */
3762 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_e,
3763 L4_MABX_P.PWMSynchFaultLimMin_Value,
3764 L4_MABX_B.If_Then_Else3_m.Switch,
3765 &L4_MABX_B.If_Then_Else1_g);
3766
3767 /* End of Outputs for SubSystem: '<S817>/If_Then_Else1' */
3768
3769 /* Outputs for Atomic SubSystem: '<S817>/If_Then_Else' */
3770
3771 /* Constant: '<S763>/PWMSynchFaultLimMax' */
3772 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_h,
3773 L4_MABX_P.PWMSynchFaultLimMax_Value,
3774 L4_MABX_B.If_Then_Else1_g.Switch,
3775 &L4_MABX_B.If_Then_Else_d);
3776
3777 /* End of Outputs for SubSystem: '<S817>/If_Then_Else' */
3778
3779 /* RelationalOperator: '<S782>/Relational Operator8' incorporates:
3780 * Constant: '<S763>/PWMSynchFaultLimMax'
3781 */
3782 L4_MABX_B.F_Fault_Hard_i = (L4_MABX_P.PWMSynchFaultLimMax_Value <=
3783 L4_MABX_B.If_Then_Else_d.Switch);
3784
3785 /* Logic: '<S744>/Logical Operator6' */
3786 L4_MABX_B.LogicalOperator6_b = (L4_MABX_B.F_Pedal_pwm_sens_total_failure ||
3787 L4_MABX_B.F_Fault_Hard_i);
3788
3789 /* Outputs for Enabled SubSystem: '<S744>/Slew_at_event' incorporates:
3790 * EnablePort: '<S767>/Enable'
3791 */
3792 /* Constant: '<S744>/F_PEDAL_TORQUE_SLEW_AT_FAULT' */
3793 if (L4_MABX_P.F_PEDAL_TORQUE_SLEW_AT_FAULT_Va) {
3794 if (!L4_MABX_DW.Slew_at_event_MODE) {
3795 /* InitializeConditions for UnitDelay: '<S838>/Unit_Delay' */
3796 L4_MABX_DW.Unit_Delay_DSTATE_m5 = L4_MABX_P.Unit_Delay_InitialCondition_ed;
3797
3798 /* InitializeConditions for UnitDelay: '<S839>/Unit_Delay' */
3799 L4_MABX_DW.Unit_Delay_DSTATE_ep = L4_MABX_P.Unit_Delay_InitialCondition_aj;
3800
3801 /* InitializeConditions for UnitDelay: '<S842>/FixPt Unit Delay2' */
3802 L4_MABX_DW.FixPtUnitDelay2_DSTATE_f =
3803 L4_MABX_P.FixPtUnitDelay2_InitialCondit_l;
3804
3805 /* InitializeConditions for UnitDelay: '<S842>/FixPt Unit Delay1' */
3806 L4_MABX_DW.FixPtUnitDelay1_DSTATE_b =
3807 L4_MABX_P.FixPtUnitDelay1_InitialCondit_k;
3808
3809 /* InitializeConditions for UnitDelay: '<S837>/Unit_Delay' */
3810 L4_MABX_DW.Unit_Delay_DSTATE_cg =
3811 L4_MABX_P.Unit_Delay_InitialCondition_had;
3812 L4_MABX_DW.Slew_at_event_MODE = true;
3813 }
3814
3815 /* UnitDelay: '<S838>/Unit_Delay' */
3816 L4_MABX_B.Unit_Delay_l1 = L4_MABX_DW.Unit_Delay_DSTATE_m5;
3817
3818 /* Logic: '<S838>/Logical Operator1' */
3819 L4_MABX_B.LogicalOperator1_h = !L4_MABX_B.Unit_Delay_l1;
3820
3821 /* Logic: '<S838>/Logical Operator' */
3822 L4_MABX_B.LogicalOperator_bu = (L4_MABX_B.LogicalOperator6_b &&
3823 L4_MABX_B.LogicalOperator1_h);
3824
3825 /* UnitDelay: '<S839>/Unit_Delay' */
3826 L4_MABX_B.Unit_Delay_ct = L4_MABX_DW.Unit_Delay_DSTATE_ep;
3827
3828 /* Logic: '<S839>/Logical Operator1' */
3829 L4_MABX_B.LogicalOperator1_jw = (L4_MABX_B.LogicalOperator_bu ||
3830 L4_MABX_B.Unit_Delay_ct);
3831
3832 /* UnitDelay: '<S842>/FixPt Unit Delay2' */
3833 L4_MABX_B.FixPtUnitDelay2_o = L4_MABX_DW.FixPtUnitDelay2_DSTATE_f;
3834
3835 /* UnitDelay: '<S842>/FixPt Unit Delay1' */
3836 L4_MABX_B.Xold_f = L4_MABX_DW.FixPtUnitDelay1_DSTATE_b;
3837
3838 /* Switch: '<S842>/Init' incorporates:
3839 * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE'
3840 */
3841 if (L4_MABX_B.FixPtUnitDelay2_o != 0) {
3842 L4_MABX_B.Init_jy = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL;
3843 } else {
3844 L4_MABX_B.Init_jy = L4_MABX_B.Xold_f;
3845 }
3846
3847 /* End of Switch: '<S842>/Init' */
3848
3849 /* Abs: '<S839>/Abs' incorporates:
3850 * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_SLEW_UP'
3851 */
3852 L4_MABX_B.Abs_p = fabs(L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFA_k);
3853
3854 /* Product: '<S839>/Product1' incorporates:
3855 * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DT'
3856 */
3857 L4_MABX_B.Product1_h = L4_MABX_B.Abs_p *
3858 L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDT_Val;
3859
3860 /* Sum: '<S839>/Add1' */
3861 L4_MABX_B.Add1_nu = L4_MABX_B.Init_jy + L4_MABX_B.Product1_h;
3862
3863 /* MinMax: '<S839>/MinMax2' incorporates:
3864 * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE'
3865 */
3866 DeltaTime = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL;
3867 PositionFinalLimited = L4_MABX_B.Add1_nu;
3868 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
3869 PositionFinalLimited = DeltaTime;
3870 }
3871
3872 L4_MABX_B.MinMax2 = PositionFinalLimited;
3873
3874 /* End of MinMax: '<S839>/MinMax2' */
3875
3876 /* Abs: '<S839>/Abs1' incorporates:
3877 * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_SLEW_DOWN'
3878 */
3879 L4_MABX_B.Abs1 = fabs(L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFA_h);
3880
3881 /* Product: '<S839>/Product2' incorporates:
3882 * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DT'
3883 */
3884 L4_MABX_B.Product2_l = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDT_Val *
3885 L4_MABX_B.Abs1;
3886
3887 /* Sum: '<S839>/Subtract1' */
3888 L4_MABX_B.Subtract1_l = L4_MABX_B.Init_jy - L4_MABX_B.Product2_l;
3889
3890 /* MinMax: '<S839>/MinMax1' */
3891 DeltaTime = L4_MABX_B.MinMax2;
3892 PositionFinalLimited = L4_MABX_B.Subtract1_l;
3893 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
3894 PositionFinalLimited = DeltaTime;
3895 }
3896
3897 L4_MABX_B.MinMax1_c = PositionFinalLimited;
3898
3899 /* End of MinMax: '<S839>/MinMax1' */
3900
3901 /* Outputs for Atomic SubSystem: '<S839>/If_Then_Else' */
3902 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_jw,
3903 L4_MABX_B.If_Then_Else_e.Switch, L4_MABX_B.MinMax1_c,
3904 &L4_MABX_B.If_Then_Else_f1);
3905
3906 /* End of Outputs for SubSystem: '<S839>/If_Then_Else' */
3907
3908 /* Sum: '<S767>/Subtract' incorporates:
3909 * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_VALUE'
3910 */
3911 L4_MABX_B.Subtract_k = L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFAUL -
3912 L4_MABX_B.If_Then_Else_f1.Switch;
3913
3914 /* Abs: '<S767>/Abs' */
3915 L4_MABX_B.Abs_k = fabs(L4_MABX_B.Subtract_k);
3916
3917 /* RelationalOperator: '<S767>/Relational Operator1' incorporates:
3918 * Constant: '<S767>/Constant1'
3919 */
3920 L4_MABX_B.RelationalOperator1_a = (L4_MABX_B.Abs_k <=
3921 L4_MABX_P.Constant1_Value_fw);
3922
3923 /* Logic: '<S837>/Logical Operator3' */
3924 L4_MABX_B.LogicalOperator3_d = !L4_MABX_B.RelationalOperator1_a;
3925
3926 /* UnitDelay: '<S837>/Unit_Delay' */
3927 L4_MABX_B.Unit_Delay_ej = L4_MABX_DW.Unit_Delay_DSTATE_cg;
3928
3929 /* Logic: '<S837>/Logical Operator1' */
3930 L4_MABX_B.LogicalOperator1_i = (L4_MABX_B.LogicalOperator6_b ||
3931 L4_MABX_B.Unit_Delay_ej);
3932
3933 /* Logic: '<S837>/Logical Operator' */
3934 L4_MABX_B.LogicalOperator_b4 = (L4_MABX_B.LogicalOperator3_d &&
3935 L4_MABX_B.LogicalOperator1_i);
3936
3937 /* Logic: '<S837>/Logical Operator2' */
3938 L4_MABX_B.LogicalOperator2_d = !L4_MABX_B.LogicalOperator_b4;
3939
3940 /* RelationalOperator: '<S840>/min_relop' incorporates:
3941 * Constant: '<S744>/PEDAL_PWM_SENSOR_DATA_APV.DEFAULT_SLEW_UP'
3942 * Constant: '<S840>/min_val'
3943 */
3944 L4_MABX_B.min_relop_n = (L4_MABX_P.CheckStaticLowerBound_min_k <=
3945 L4_MABX_P.PEDAL_PWM_SENSOR_DATA_APVDEFA_k);
3946
3947 /* Assertion: '<S840>/Assertion' */
3948 utAssert(L4_MABX_B.min_relop_n);
3949 } else {
3950 if (L4_MABX_DW.Slew_at_event_MODE) {
3951 /* Disable for Outport: '<S767>/F_Out_slewing' */
3952 L4_MABX_B.LogicalOperator_b4 = L4_MABX_P.F_Out_slewing_Y0_c;
3953
3954 /* Disable for Outport: '<S767>/Out' */
3955 L4_MABX_B.If_Then_Else_f1.Switch = L4_MABX_P.Out_Y0_f;
3956 L4_MABX_DW.Slew_at_event_MODE = false;
3957 }
3958 }
3959
3960 /* End of Constant: '<S744>/F_PEDAL_TORQUE_SLEW_AT_FAULT' */
3961 /* End of Outputs for SubSystem: '<S744>/Slew_at_event' */
3962
3963 /* Outputs for Atomic SubSystem: '<S744>/If_Then_Else' */
3964 L4_MABX_If_Then_Else_b(L4_MABX_B.LogicalOperator_b4,
3965 L4_MABX_B.If_Then_Else_f1.Switch, L4_MABX_B.If_Then_Else_e.Switch);
3966
3967 /* End of Outputs for SubSystem: '<S744>/If_Then_Else' */
3968
3969 /* S-Function (rti_commonblock): '<S732>/S-Function1' */
3970 /* This comment workarounds a code generation problem */
3971 {
3972 /* dSPACE I/O Board DS1401STDADCT4 #1 Unit:ADC Group:ADC */
3973 adc_tp4_single_new_read(ADC_TP4_1_MODULE_ADDR,
3974 ADC_TP4_CH3,
3975 (dsfloat *)&L4_MABX_B.SFunction1);
3976 }
3977
3978 /* Gain: '<S416>/KL15_Monitor' */
3979 L4_MABX_B.IgnitionKeySwitch_voltage = L4_MABX_P.KL15_Monitor_Gain *
3980 L4_MABX_B.SFunction1;
3981
3982 /* Outputs for Enabled SubSystem: '<S507>/CCVS1_31' incorporates:
3983 * EnablePort: '<S508>/Enable'
3984 */
3985 /* Constant: '<S430>/Constant' */
3986 if (L4_MABX_P.Constant_Value_lj) {
3987 /* S-Function (rti_commonblock): '<S508>/S-Function1' */
3988 /* This comment workarounds a code generation problem */
3989
3990 /* dSPACE RTICAN RX Message Block: "CCVS1_31" Id:419361073 */
3991 {
3992 UInt32 *CAN_Msg;
3993 static dsfloat time_old = 0.0;
3994
3995 /* Read status and timestamp info (previous message) */
3996 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].timestamp !=
3997 time_old) {
3998 /* ... save timestamp info for the calculation of the RX status
3999 during the consecutive sample hit*/
4000 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].
4001 timestamp;
4002
4003 /* ... set the processed flag to one */
4004 L4_MABX_B.SFunction1_o21_j = 1.0;
4005 L4_MABX_B.SFunction1_o22_a = (real_T)
4006 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].timestamp;
4007 L4_MABX_B.SFunction1_o23_n = (real_T)
4008 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].deltatime;
4009 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF131].data;
4010
4011 /* Decode CAN message */
4012 {
4013 {
4014 rtican_Signal_t CAN_Sgn;
4015
4016 /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */
4017 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4018 CAN_Sgn.UnsignedSgn &= 0x00000003;
4019 L4_MABX_B.SFunction1_o1_em = ((real_T) CAN_Sgn.UnsignedSgn);
4020
4021 /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */
4022 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4023 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
4024 CAN_Sgn.UnsignedSgn &= 0x00000003;
4025 L4_MABX_B.SFunction1_o2_gh = ((real_T) CAN_Sgn.UnsignedSgn);
4026
4027 /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */
4028 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4029 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4030 CAN_Sgn.UnsignedSgn &= 0x00000003;
4031 L4_MABX_B.SFunction1_o3_kk = ((real_T) CAN_Sgn.UnsignedSgn);
4032
4033 /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */
4034 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4035 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
4036 CAN_Sgn.UnsignedSgn &= 0x00000003;
4037 L4_MABX_B.SFunction1_o4_pw = ((real_T) CAN_Sgn.UnsignedSgn);
4038
4039 /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */
4040 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
4041 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
4042 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
4043 L4_MABX_B.SFunction1_o5_dz = 0.00390625 * ( ((real_T)
4044 CAN_Sgn.UnsignedSgn) );
4045
4046 /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */
4047 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4048 CAN_Sgn.UnsignedSgn &= 0x00000003;
4049 L4_MABX_B.SFunction1_o6_hc = ((real_T) CAN_Sgn.UnsignedSgn);
4050
4051 /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */
4052 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4053 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
4054 CAN_Sgn.UnsignedSgn &= 0x00000003;
4055 L4_MABX_B.SFunction1_o7_au = ((real_T) CAN_Sgn.UnsignedSgn);
4056
4057 /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */
4058 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4059 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4060 CAN_Sgn.UnsignedSgn &= 0x00000003;
4061 L4_MABX_B.SFunction1_o8_ct = ((real_T) CAN_Sgn.UnsignedSgn);
4062
4063 /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */
4064 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4065 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
4066 CAN_Sgn.UnsignedSgn &= 0x00000003;
4067 L4_MABX_B.SFunction1_o9_g3 = ((real_T) CAN_Sgn.UnsignedSgn);
4068
4069 /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */
4070 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
4071 CAN_Sgn.UnsignedSgn &= 0x00000003;
4072 L4_MABX_B.SFunction1_o10_nn = ((real_T) CAN_Sgn.UnsignedSgn);
4073
4074 /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */
4075 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
4076 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
4077 CAN_Sgn.UnsignedSgn &= 0x00000003;
4078 L4_MABX_B.SFunction1_o11_b = ((real_T) CAN_Sgn.UnsignedSgn);
4079
4080 /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */
4081 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
4082 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4083 CAN_Sgn.UnsignedSgn &= 0x00000003;
4084 L4_MABX_B.SFunction1_o12_d = ((real_T) CAN_Sgn.UnsignedSgn);
4085
4086 /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */
4087 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
4088 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
4089 CAN_Sgn.UnsignedSgn &= 0x00000003;
4090 L4_MABX_B.SFunction1_o13_hi = ((real_T) CAN_Sgn.UnsignedSgn);
4091
4092 /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */
4093 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
4094 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4095 L4_MABX_B.SFunction1_o14_px = ((real_T) CAN_Sgn.UnsignedSgn);
4096
4097 /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */
4098 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4099 CAN_Sgn.UnsignedSgn &= 0x0000001F;
4100 L4_MABX_B.SFunction1_o15_m = ((real_T) CAN_Sgn.UnsignedSgn);
4101
4102 /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */
4103 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4104 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 5;
4105 CAN_Sgn.UnsignedSgn &= 0x00000007;
4106 L4_MABX_B.SFunction1_o16_lm = ((real_T) CAN_Sgn.UnsignedSgn);
4107
4108 /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */
4109 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
4110 CAN_Sgn.UnsignedSgn &= 0x00000003;
4111 L4_MABX_B.SFunction1_o17_d = ((real_T) CAN_Sgn.UnsignedSgn);
4112
4113 /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */
4114 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
4115 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
4116 CAN_Sgn.UnsignedSgn &= 0x00000003;
4117 L4_MABX_B.SFunction1_o18_d = ((real_T) CAN_Sgn.UnsignedSgn);
4118
4119 /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */
4120 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
4121 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4122 CAN_Sgn.UnsignedSgn &= 0x00000003;
4123 L4_MABX_B.SFunction1_o19_d = ((real_T) CAN_Sgn.UnsignedSgn);
4124
4125 /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */
4126 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
4127 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
4128 CAN_Sgn.UnsignedSgn &= 0x00000003;
4129 L4_MABX_B.SFunction1_o20_a = ((real_T) CAN_Sgn.UnsignedSgn);
4130 }
4131 }
4132 } else {
4133 /* set RX status to 0 because no new message has arrived */
4134 L4_MABX_B.SFunction1_o21_j = 0.0;
4135 }
4136 }
4137 }
4138
4139 /* End of Constant: '<S430>/Constant' */
4140 /* End of Outputs for SubSystem: '<S507>/CCVS1_31' */
4141
4142 /* Outputs for Enabled SubSystem: '<S518>/EBC2_0B1' incorporates:
4143 * EnablePort: '<S519>/Enable'
4144 */
4145 /* Constant: '<S435>/Enable_RX_EBC2_0B' */
4146 if (L4_MABX_P.Enable_RX_EBC2_0B_Value) {
4147 /* S-Function (rti_commonblock): '<S519>/S-Function1' */
4148 /* This comment workarounds a code generation problem */
4149
4150 /* dSPACE RTICAN RX Message Block: "EBC2_0B" Id:419348235 */
4151 {
4152 UInt32 *CAN_Msg;
4153 static dsfloat time_old = 0.0;
4154
4155 /* Read status and timestamp info (previous message) */
4156 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].timestamp !=
4157 time_old) {
4158 /* ... save timestamp info for the calculation of the RX status
4159 during the consecutive sample hit*/
4160 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].
4161 timestamp;
4162
4163 /* ... set the processed flag to one */
4164 L4_MABX_B.SFunction1_o8_g = 1.0;
4165 L4_MABX_B.SFunction1_o9_cm = (real_T)
4166 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].timestamp;
4167 L4_MABX_B.SFunction1_o10_ey = (real_T)
4168 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].deltatime;
4169 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEBF0B].data;
4170
4171 /* Decode CAN message */
4172 {
4173 {
4174 rtican_Signal_t CAN_Sgn;
4175
4176 /* ...... "FrontAxleSpeed" (0|16, standard signal, unsigned int, little endian) */
4177 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4178 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
4179 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
4180 L4_MABX_B.SFunction1_o1_ie = 0.00390625 * ( ((real_T)
4181 CAN_Sgn.UnsignedSgn) );
4182
4183 /* ...... "RelativeSpeedFrontAxleLeftWheel" (16|8, standard signal, unsigned int, little endian) */
4184 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
4185 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4186 L4_MABX_B.SFunction1_o2_js = -7.8125 + ( 0.0625 * ( ((real_T)
4187 CAN_Sgn.UnsignedSgn) ) );
4188
4189 /* ...... "RlativeSpeedFrontAxleRightWheel" (24|8, standard signal, unsigned int, little endian) */
4190 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4191 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4192 L4_MABX_B.SFunction1_o3_a3 = -7.8125 + ( 0.0625 * ( ((real_T)
4193 CAN_Sgn.UnsignedSgn) ) );
4194
4195 /* ...... "RelativeSpeedRearAxle1LeftWheel" (32|8, standard signal, unsigned int, little endian) */
4196 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
4197 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4198 L4_MABX_B.SFunction1_o4_o2 = -7.8125 + ( 0.0625 * ( ((real_T)
4199 CAN_Sgn.UnsignedSgn) ) );
4200
4201 /* ...... "RlativeSpeedRearAxle1RightWheel" (40|8, standard signal, unsigned int, little endian) */
4202 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
4203 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4204 L4_MABX_B.SFunction1_o5_co = -7.8125 + ( 0.0625 * ( ((real_T)
4205 CAN_Sgn.UnsignedSgn) ) );
4206
4207 /* ...... "RelativeSpeedRearAxle2LeftWheel" (48|8, standard signal, unsigned int, little endian) */
4208 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4209 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4210 L4_MABX_B.SFunction1_o6_j = -7.8125 + ( 0.0625 * ( ((real_T)
4211 CAN_Sgn.UnsignedSgn) ) );
4212
4213 /* ...... "RlativeSpeedRearAxle2RightWheel" (56|8, standard signal, unsigned int, little endian) */
4214 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
4215 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4216 L4_MABX_B.SFunction1_o7_b = -7.8125 + ( 0.0625 * ( ((real_T)
4217 CAN_Sgn.UnsignedSgn) ) );
4218 }
4219 }
4220 } else {
4221 /* set RX status to 0 because no new message has arrived */
4222 L4_MABX_B.SFunction1_o8_g = 0.0;
4223 }
4224 }
4225 }
4226
4227 /* End of Constant: '<S435>/Enable_RX_EBC2_0B' */
4228 /* End of Outputs for SubSystem: '<S518>/EBC2_0B1' */
4229
4230 /* Outputs for Enabled SubSystem: '<S576>/HRW_0B' incorporates:
4231 * EnablePort: '<S577>/Enable'
4232 */
4233 /* Constant: '<S442>/Enable_HRW_RX_0B' */
4234 if (L4_MABX_P.Enable_HRW_RX_0B_Value) {
4235 /* S-Function (rti_commonblock): '<S577>/S-Function1' */
4236 /* This comment workarounds a code generation problem */
4237
4238 /* dSPACE RTICAN RX Message Block: "HRW_0B" Id:150892043 */
4239 {
4240 UInt32 *CAN_Msg;
4241 static dsfloat time_old = 0.0;
4242
4243 /* Read status and timestamp info (previous message) */
4244 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].timestamp !=
4245 time_old) {
4246 /* ... save timestamp info for the calculation of the RX status
4247 during the consecutive sample hit*/
4248 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].
4249 timestamp;
4250
4251 /* ... set the processed flag to one */
4252 L4_MABX_B.SFunction1_o5_b0 = 1.0;
4253 L4_MABX_B.SFunction1_o6_a = (real_T)
4254 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].timestamp;
4255 L4_MABX_B.SFunction1_o7_j = (real_T)
4256 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].deltatime;
4257 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x8FE6E0B].data;
4258
4259 /* Decode CAN message */
4260 {
4261 {
4262 rtican_Signal_t CAN_Sgn;
4263
4264 /* ...... "FrontAxleLeftWheelSpeed" (0|16, standard signal, unsigned int, little endian) */
4265 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4266 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
4267 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
4268 L4_MABX_B.SFunction1_o1_i4 = 0.00390625 * ( ((real_T)
4269 CAN_Sgn.UnsignedSgn) );
4270
4271 /* ...... "FrontAxleRightWheelSpeed" (16|16, standard signal, unsigned int, little endian) */
4272 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
4273 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
4274 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
4275 L4_MABX_B.SFunction1_o2_da = 0.00390625 * ( ((real_T)
4276 CAN_Sgn.UnsignedSgn) );
4277
4278 /* ...... "RearAxleLeftWheelSpeed" (32|16, standard signal, unsigned int, little endian) */
4279 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
4280 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
4281 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
4282 L4_MABX_B.SFunction1_o3_p1 = 0.00390625 * ( ((real_T)
4283 CAN_Sgn.UnsignedSgn) );
4284
4285 /* ...... "RearAxleRightWheelSpeed" (48|16, standard signal, unsigned int, little endian) */
4286 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4287 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7];
4288 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
4289 L4_MABX_B.SFunction1_o4_aj = 0.00390625 * ( ((real_T)
4290 CAN_Sgn.UnsignedSgn) );
4291 }
4292 }
4293 } else {
4294 /* set RX status to 0 because no new message has arrived */
4295 L4_MABX_B.SFunction1_o5_b0 = 0.0;
4296 }
4297 }
4298 }
4299
4300 /* End of Constant: '<S442>/Enable_HRW_RX_0B' */
4301 /* End of Outputs for SubSystem: '<S576>/HRW_0B' */
4302
4303 /* Outputs for Enabled SubSystem: '<S516>/EBC1_0B' incorporates:
4304 * EnablePort: '<S517>/Enable'
4305 */
4306 /* Constant: '<S434>/Constant1' */
4307 if (L4_MABX_P.Constant1_Value_ls) {
4308 /* S-Function (rti_commonblock): '<S517>/S-Function1' */
4309 /* This comment workarounds a code generation problem */
4310
4311 /* dSPACE RTICAN RX Message Block: "EBC1_0B" Id:418382219 */
4312 {
4313 UInt32 *CAN_Msg;
4314 static dsfloat time_old = 0.0;
4315
4316 /* Read status and timestamp info (previous message) */
4317 if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].timestamp !=
4318 time_old) {
4319 /* ... save timestamp info for the calculation of the RX status
4320 during the consecutive sample hit*/
4321 time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].
4322 timestamp;
4323
4324 /* ... set the processed flag to one */
4325 L4_MABX_B.SFunction1_o23_i = 1.0;
4326 L4_MABX_B.SFunction1_o24_a = (real_T)
4327 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].timestamp;
4328 L4_MABX_B.SFunction1_o25_p = (real_T)
4329 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].deltatime;
4330 CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18F0018B].data;
4331
4332 /* Decode CAN message */
4333 {
4334 {
4335 rtican_Signal_t CAN_Sgn;
4336
4337 /* ...... "ASREngCtrlActive" (0|2, standard signal, unsigned int, little endian) */
4338 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4339 CAN_Sgn.UnsignedSgn &= 0x00000003;
4340 L4_MABX_B.SFunction1_o1_mb = ((real_T) CAN_Sgn.UnsignedSgn);
4341
4342 /* ...... "ASRBrakeCtrlActive" (2|2, standard signal, unsigned int, little endian) */
4343 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4344 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
4345 CAN_Sgn.UnsignedSgn &= 0x00000003;
4346 L4_MABX_B.SFunction1_o2_i1 = ((real_T) CAN_Sgn.UnsignedSgn);
4347
4348 /* ...... "AntiLockBrakingActive" (4|2, standard signal, unsigned int, little endian) */
4349 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4350 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4351 CAN_Sgn.UnsignedSgn &= 0x00000003;
4352 L4_MABX_B.SFunction1_o3_ac = ((real_T) CAN_Sgn.UnsignedSgn);
4353
4354 /* ...... "EBSBrakeSwitch" (6|2, standard signal, unsigned int, little endian) */
4355 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4356 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
4357 CAN_Sgn.UnsignedSgn &= 0x00000003;
4358 L4_MABX_B.SFunction1_o4_oc = ((real_T) CAN_Sgn.UnsignedSgn);
4359
4360 /* ...... "BrakePedalPos" (8|8, standard signal, unsigned int, little endian) */
4361 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
4362 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4363 L4_MABX_B.SFunction1_o5_md = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
4364
4365 /* ...... "ABSOffroadSwitch" (16|2, standard signal, unsigned int, little endian) */
4366 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
4367 CAN_Sgn.UnsignedSgn &= 0x00000003;
4368 L4_MABX_B.SFunction1_o6_oc = ((real_T) CAN_Sgn.UnsignedSgn);
4369
4370 /* ...... "ASROffroadSwitch" (18|2, standard signal, unsigned int, little endian) */
4371 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
4372 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
4373 CAN_Sgn.UnsignedSgn &= 0x00000003;
4374 L4_MABX_B.SFunction1_o7_d = ((real_T) CAN_Sgn.UnsignedSgn);
4375
4376 /* ...... "ASRHillHolderSwitch" (20|2, standard signal, unsigned int, little endian) */
4377 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
4378 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4379 CAN_Sgn.UnsignedSgn &= 0x00000003;
4380 L4_MABX_B.SFunction1_o8_l1 = ((real_T) CAN_Sgn.UnsignedSgn);
4381
4382 /* ...... "TractionCtrlOverrideSwitch" (22|2, standard signal, unsigned int, little endian) */
4383 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
4384 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
4385 CAN_Sgn.UnsignedSgn &= 0x00000003;
4386 L4_MABX_B.SFunction1_o9_lw = ((real_T) CAN_Sgn.UnsignedSgn);
4387
4388 /* ...... "AccelInterlockSwitch" (24|2, standard signal, unsigned int, little endian) */
4389 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4390 CAN_Sgn.UnsignedSgn &= 0x00000003;
4391 L4_MABX_B.SFunction1_o10_h = ((real_T) CAN_Sgn.UnsignedSgn);
4392
4393 /* ...... "EngDerateSwitch" (26|2, standard signal, unsigned int, little endian) */
4394 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4395 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
4396 CAN_Sgn.UnsignedSgn &= 0x00000003;
4397 L4_MABX_B.SFunction1_o11_ay = ((real_T) CAN_Sgn.UnsignedSgn);
4398
4399 /* ...... "EngAuxShutdownSwitch" (28|2, standard signal, unsigned int, little endian) */
4400 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4401 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4402 CAN_Sgn.UnsignedSgn &= 0x00000003;
4403 L4_MABX_B.SFunction1_o12_j = ((real_T) CAN_Sgn.UnsignedSgn);
4404
4405 /* ...... "RemoteAccelEnableSwitch" (30|2, standard signal, unsigned int, little endian) */
4406 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4407 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
4408 CAN_Sgn.UnsignedSgn &= 0x00000003;
4409 L4_MABX_B.SFunction1_o13_gt = ((real_T) CAN_Sgn.UnsignedSgn);
4410
4411 /* ...... "EngRetarderSelection" (32|8, standard signal, unsigned int, little endian) */
4412 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
4413 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4414 L4_MABX_B.SFunction1_o14_h = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
4415
4416 /* ...... "ABSFullyOperational" (40|2, standard signal, unsigned int, little endian) */
4417 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
4418 CAN_Sgn.UnsignedSgn &= 0x00000003;
4419 L4_MABX_B.SFunction1_o15_k = ((real_T) CAN_Sgn.UnsignedSgn);
4420
4421 /* ...... "EBSRedWarningSignal" (42|2, standard signal, unsigned int, little endian) */
4422 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
4423 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
4424 CAN_Sgn.UnsignedSgn &= 0x00000003;
4425 L4_MABX_B.SFunction1_o16_l = ((real_T) CAN_Sgn.UnsignedSgn);
4426
4427 /* ...... "ABS_EBSAmberWarningSignal" (44|2, standard signal, unsigned int, little endian) */
4428 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
4429 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4430 CAN_Sgn.UnsignedSgn &= 0x00000003;
4431 L4_MABX_B.SFunction1_o17_m = ((real_T) CAN_Sgn.UnsignedSgn);
4432
4433 /* ...... "ATC_ASRInformationSignal" (46|2, standard signal, unsigned int, little endian) */
4434 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
4435 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
4436 CAN_Sgn.UnsignedSgn &= 0x00000003;
4437 L4_MABX_B.SFunction1_o18_j = ((real_T) CAN_Sgn.UnsignedSgn);
4438
4439 /* ...... "SrcAddrssOfCtrllngDvcFrBrkCntrl" (48|8, standard signal, unsigned int, little endian) */
4440 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4441 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4442 L4_MABX_B.SFunction1_o19_h = ((real_T) CAN_Sgn.UnsignedSgn);
4443
4444 /* ...... "HaltBrakeSwitch" (58|2, standard signal, unsigned int, little endian) */
4445 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
4446 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
4447 CAN_Sgn.UnsignedSgn &= 0x00000003;
4448 L4_MABX_B.SFunction1_o20_j = ((real_T) CAN_Sgn.UnsignedSgn);
4449
4450 /* ...... "TrailerABSStatus" (60|2, standard signal, unsigned int, little endian) */
4451 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
4452 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4453 CAN_Sgn.UnsignedSgn &= 0x00000003;
4454 L4_MABX_B.SFunction1_o21_p = ((real_T) CAN_Sgn.UnsignedSgn);
4455
4456 /* ...... "TrctrMntdTrilerABSWarningSignal" (62|2, standard signal, unsigned int, little endian) */
4457 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
4458 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
4459 CAN_Sgn.UnsignedSgn &= 0x00000003;
4460 L4_MABX_B.SFunction1_o22_e = ((real_T) CAN_Sgn.UnsignedSgn);
4461 }
4462 }
4463 } else {
4464 /* set RX status to 0 because no new message has arrived */
4465 L4_MABX_B.SFunction1_o23_i = 0.0;
4466 }
4467 }
4468 }
4469
4470 /* End of Constant: '<S434>/Constant1' */
4471 /* End of Outputs for SubSystem: '<S516>/EBC1_0B' */
4472
4473 /* Outputs for Enabled SubSystem: '<S571>/ETC2_031' incorporates:
4474 * EnablePort: '<S572>/Enable'
4475 */
4476 /* Constant: '<S440>/Enable_RX_ETC2_03' */
4477 if (L4_MABX_P.Enable_RX_ETC2_03_Value) {
4478 /* S-Function (rti_commonblock): '<S572>/S-Function1' */
4479 /* This comment workarounds a code generation problem */
4480
4481 /* dSPACE RTICAN RX Message Block: "ETC2_03" Id:418383107 */
4482 {
4483 UInt32 *CAN_Msg;
4484 static dsfloat time_old = 0.0;
4485
4486 /* Read status and timestamp info (previous message) */
4487 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].timestamp !=
4488 time_old) {
4489 /* ... save timestamp info for the calculation of the RX status
4490 during the consecutive sample hit*/
4491 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].
4492 timestamp;
4493
4494 /* ... set the processed flag to one */
4495 L4_MABX_B.SFunction1_o4_b3 = 1.0;
4496 L4_MABX_B.SFunction1_o5_lx = (real_T)
4497 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].timestamp;
4498 L4_MABX_B.SFunction1_o6_m = (real_T)
4499 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].deltatime;
4500 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F00503].data;
4501
4502 /* Decode CAN message */
4503 {
4504 {
4505 rtican_Signal_t CAN_Sgn;
4506
4507 /* ...... "SPN524_TransSelectedGear" (0|8, standard signal, unsigned int, little endian) */
4508 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4509 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4510 L4_MABX_B.SFunction1_o1_lx = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn)
4511 );
4512
4513 /* ...... "SPN526_TransActualGearRatio" (8|16, standard signal, unsigned int, little endian) */
4514 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
4515 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
4516 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
4517 L4_MABX_B.SFunction1_o2_fb = 0.001 * ( ((real_T) CAN_Sgn.UnsignedSgn)
4518 );
4519
4520 /* ...... "SPN523_TransCurrentGear" (24|8, standard signal, unsigned int, little endian) */
4521 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4522 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4523 L4_MABX_B.SFunction1_o3_js = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn)
4524 );
4525 }
4526 }
4527 } else {
4528 /* set RX status to 0 because no new message has arrived */
4529 L4_MABX_B.SFunction1_o4_b3 = 0.0;
4530 }
4531 }
4532 }
4533
4534 /* End of Constant: '<S440>/Enable_RX_ETC2_03' */
4535 /* End of Outputs for SubSystem: '<S571>/ETC2_031' */
4536
4537 /* DataTypeConversion: '<S571>/Data Type Conversion1' */
4538 L4_MABX_B.SPN524_TransSelectedGear = L4_MABX_B.SFunction1_o1_lx;
4539
4540 /* DataTypeConversion: '<S571>/Data Type Conversion2' */
4541 L4_MABX_B.SPN523_TransCurrentGear = L4_MABX_B.SFunction1_o3_js;
4542
4543 /* DataTypeConversion: '<S571>/Data Type Conversion3' */
4544 L4_MABX_B.SPN526_TransActualGearRatio = L4_MABX_B.SFunction1_o2_fb;
4545
4546 /* Outputs for Enabled SubSystem: '<S565>/EEC1_001' incorporates:
4547 * EnablePort: '<S566>/Enable'
4548 */
4549 /* Constant: '<S437>/Enable_RX_EEC1_00' */
4550 if (L4_MABX_P.Enable_RX_EEC1_00_Value) {
4551 /* S-Function (rti_commonblock): '<S566>/S-Function1' */
4552 /* This comment workarounds a code generation problem */
4553
4554 /* dSPACE RTICAN RX Message Block: "EEC1_00" Id:217056256 */
4555 {
4556 UInt32 *CAN_Msg;
4557 static dsfloat time_old = 0.0;
4558
4559 /* Read status and timestamp info (previous message) */
4560 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].timestamp !=
4561 time_old) {
4562 /* ... save timestamp info for the calculation of the RX status
4563 during the consecutive sample hit*/
4564 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].
4565 timestamp;
4566
4567 /* ... set the processed flag to one */
4568 L4_MABX_B.SFunction1_o9_px = 1.0;
4569 L4_MABX_B.SFunction1_o10_ft = (real_T)
4570 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].timestamp;
4571 L4_MABX_B.SFunction1_o11_g = (real_T)
4572 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].deltatime;
4573 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF00400].data;
4574
4575 /* Decode CAN message */
4576 {
4577 {
4578 rtican_Signal_t CAN_Sgn;
4579
4580 /* ...... "EngTorqueMode" (0|4, standard signal, unsigned int, little endian) */
4581 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4582 CAN_Sgn.UnsignedSgn &= 0x0000000F;
4583 L4_MABX_B.SFunction1_o1_mp = ((real_T) CAN_Sgn.UnsignedSgn);
4584
4585 /* ...... "ActlEngPrcntTrqueHighResolution" (4|4, standard signal, unsigned int, little endian) */
4586 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4587 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4588 CAN_Sgn.UnsignedSgn &= 0x0000000F;
4589 L4_MABX_B.SFunction1_o2_a4 = 0.125 * ( ((real_T) CAN_Sgn.UnsignedSgn)
4590 );
4591
4592 /* ...... "DriversDemandEngPercentTorque" (8|8, standard signal, unsigned int, little endian) */
4593 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
4594 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4595 L4_MABX_B.SFunction1_o3_ob = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn)
4596 );
4597
4598 /* ...... "ActualEngPercentTorque" (16|8, standard signal, unsigned int, little endian) */
4599 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
4600 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4601 L4_MABX_B.SFunction1_o4_jr = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn)
4602 );
4603
4604 /* ...... "EngSpeed" (24|16, standard signal, unsigned int, little endian) */
4605 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4606 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
4607 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
4608 L4_MABX_B.SFunction1_o5_en = 0.125 * ( ((real_T) CAN_Sgn.UnsignedSgn)
4609 );
4610
4611 /* ...... "SrcAddrssOfCtrllngDvcFrEngCntrl" (40|8, standard signal, unsigned int, little endian) */
4612 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
4613 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4614 L4_MABX_B.SFunction1_o6_cv = ((real_T) CAN_Sgn.UnsignedSgn);
4615
4616 /* ...... "EngStarterMode" (48|4, standard signal, unsigned int, little endian) */
4617 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4618 CAN_Sgn.UnsignedSgn &= 0x0000000F;
4619 L4_MABX_B.SFunction1_o7_ny = ((real_T) CAN_Sgn.UnsignedSgn);
4620
4621 /* ...... "EngDemandPercentTorque" (56|8, standard signal, unsigned int, little endian) */
4622 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
4623 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4624 L4_MABX_B.SFunction1_o8_ab = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn)
4625 );
4626 }
4627 }
4628 } else {
4629 /* set RX status to 0 because no new message has arrived */
4630 L4_MABX_B.SFunction1_o9_px = 0.0;
4631 }
4632 }
4633 }
4634
4635 /* End of Constant: '<S437>/Enable_RX_EEC1_00' */
4636 /* End of Outputs for SubSystem: '<S565>/EEC1_001' */
4637
4638 /* Outputs for Enabled SubSystem: '<S569>/EEC3_001' incorporates:
4639 * EnablePort: '<S570>/Enable'
4640 */
4641 /* Constant: '<S439>/Enable_RX_EEC3_00' */
4642 if (L4_MABX_P.Enable_RX_EEC3_00_Value) {
4643 /* S-Function (rti_commonblock): '<S570>/S-Function1' */
4644 /* This comment workarounds a code generation problem */
4645
4646 /* dSPACE RTICAN RX Message Block: "EEC3_00" Id:419356416 */
4647 {
4648 UInt32 *CAN_Msg;
4649 static dsfloat time_old = 0.0;
4650
4651 /* Read status and timestamp info (previous message) */
4652 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].timestamp !=
4653 time_old) {
4654 /* ... save timestamp info for the calculation of the RX status
4655 during the consecutive sample hit*/
4656 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].
4657 timestamp;
4658
4659 /* ... set the processed flag to one */
4660 L4_MABX_B.SFunction1_o3_ji = 1.0;
4661 L4_MABX_B.SFunction1_o4_lp = (real_T)
4662 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].timestamp;
4663 L4_MABX_B.SFunction1_o5_gf = (real_T)
4664 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].deltatime;
4665 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEDF00].data;
4666
4667 /* Decode CAN message */
4668 {
4669 {
4670 rtican_Signal_t CAN_Sgn;
4671
4672 /* ...... "SPN514_NominalFrictionPercentTorque" (0|8, standard signal, unsigned int, little endian) */
4673 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4674 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4675 L4_MABX_B.SFunction1_o1_nn = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn)
4676 );
4677
4678 /* ...... "SPN2978_EstEngParasiticLossesPercentTorque" (32|8, standard signal, unsigned int, little endian) */
4679 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
4680 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4681 L4_MABX_B.SFunction1_o2_mg = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn)
4682 );
4683 }
4684 }
4685 } else {
4686 /* set RX status to 0 because no new message has arrived */
4687 L4_MABX_B.SFunction1_o3_ji = 0.0;
4688 }
4689 }
4690 }
4691
4692 /* End of Constant: '<S439>/Enable_RX_EEC3_00' */
4693 /* End of Outputs for SubSystem: '<S569>/EEC3_001' */
4694
4695 /* DataTypeConversion: '<S569>/Data Type Conversion2' */
4696 L4_MABX_B.SPN514_NominalFrictionPercentTo = L4_MABX_B.SFunction1_o1_nn;
4697
4698 /* DataTypeConversion: '<S569>/Data Type Conversion1' */
4699 L4_MABX_B.SPN2978_EstEngParasiticLossesPe = L4_MABX_B.SFunction1_o2_mg;
4700
4701 /* Outputs for Enabled SubSystem: '<S512>/CVW_0B1' incorporates:
4702 * EnablePort: '<S513>/Enable'
4703 */
4704 /* Constant: '<S432>/Constant' */
4705 if (L4_MABX_P.Constant_Value_hc) {
4706 /* S-Function (rti_commonblock): '<S513>/S-Function1' */
4707 /* This comment workarounds a code generation problem */
4708
4709 /* dSPACE RTICAN RX Message Block: "CVW_0B" Id:419328011 */
4710 {
4711 UInt32 *CAN_Msg;
4712 static dsfloat time_old = 0.0;
4713
4714 /* Read status and timestamp info (previous message) */
4715 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].timestamp !=
4716 time_old) {
4717 /* ... save timestamp info for the calculation of the RX status
4718 during the consecutive sample hit*/
4719 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].
4720 timestamp;
4721
4722 /* ... set the processed flag to one */
4723 L4_MABX_B.SFunction1_o2_ap = 1.0;
4724 L4_MABX_B.SFunction1_o3_dd = (real_T)
4725 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].timestamp;
4726 L4_MABX_B.SFunction1_o4_ii = (real_T)
4727 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].deltatime;
4728 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE700B].data;
4729
4730 /* Decode CAN message */
4731 {
4732 {
4733 rtican_Signal_t CAN_Sgn;
4734
4735 /* ...... "SPN1760_GrossCombinationVehicleWeight" (16|16, standard signal, unsigned int, little endian) */
4736 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
4737 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
4738 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
4739 L4_MABX_B.SFunction1_o1_am = 10 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
4740 }
4741 }
4742 } else {
4743 /* set RX status to 0 because no new message has arrived */
4744 L4_MABX_B.SFunction1_o2_ap = 0.0;
4745 }
4746 }
4747 }
4748
4749 /* End of Constant: '<S432>/Constant' */
4750 /* End of Outputs for SubSystem: '<S512>/CVW_0B1' */
4751
4752 /* DataTypeConversion: '<S512>/Data Type Conversion1' */
4753 L4_MABX_B.SPN1760_GrossCombinationVehicle = L4_MABX_B.SFunction1_o1_am;
4754
4755 /* Outputs for Enabled SubSystem: '<S493>/ACC1_2A_' incorporates:
4756 * EnablePort: '<S494>/Enable'
4757 */
4758 /* Constant: '<S423>/Constant' */
4759 if (L4_MABX_P.Constant_Value_c5) {
4760 /* S-Function (rti_commonblock): '<S494>/S-Function1' */
4761 /* This comment workarounds a code generation problem */
4762
4763 /* dSPACE RTICAN RX Message Block: "ACC1_2A" Id:285110058 */
4764 {
4765 UInt32 *CAN_Msg;
4766 static dsfloat time_old = 0.0;
4767
4768 /* Read status and timestamp info (previous message) */
4769 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].timestamp !=
4770 time_old) {
4771 /* ... save timestamp info for the calculation of the RX status
4772 during the consecutive sample hit*/
4773 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].
4774 timestamp;
4775
4776 /* ... set the processed flag to one */
4777 L4_MABX_B.SFunction1_o11_e = 1.0;
4778 L4_MABX_B.SFunction1_o12_ag = (real_T)
4779 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].timestamp;
4780 L4_MABX_B.SFunction1_o13_i = (real_T)
4781 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].deltatime;
4782 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x10FE6F2A].data;
4783
4784 /* Decode CAN message */
4785 {
4786 {
4787 rtican_Signal_t CAN_Sgn;
4788
4789 /* ...... "SpeedOfForwardVehicle" (0|8, standard signal, unsigned int, little endian) */
4790 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4791 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4792 L4_MABX_B.SFunction1_o1_lz = ((real_T) CAN_Sgn.UnsignedSgn);
4793
4794 /* ...... "DistanceToForwardVehicle" (8|8, standard signal, unsigned int, little endian) */
4795 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
4796 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4797 L4_MABX_B.SFunction1_o2_cq = ((real_T) CAN_Sgn.UnsignedSgn);
4798
4799 /* ...... "AdaptiveCruiseCtrlSetSpeed" (16|8, standard signal, unsigned int, little endian) */
4800 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
4801 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4802 L4_MABX_B.SFunction1_o3_ew = ((real_T) CAN_Sgn.UnsignedSgn);
4803
4804 /* ...... "AdaptiveCruiseCtrlMode" (24|3, standard signal, unsigned int, little endian) */
4805 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4806 CAN_Sgn.UnsignedSgn &= 0x00000007;
4807 L4_MABX_B.SFunction1_o4_jvw = ((real_T) CAN_Sgn.UnsignedSgn);
4808
4809 /* ...... "AdptveCruiseCtrlSetDistanceMode" (27|3, standard signal, unsigned int, little endian) */
4810 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4811 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 3;
4812 CAN_Sgn.UnsignedSgn &= 0x00000007;
4813 L4_MABX_B.SFunction1_o5_p3 = ((real_T) CAN_Sgn.UnsignedSgn);
4814
4815 /* ...... "RoadCurvature" (32|16, standard signal, unsigned int, little endian) */
4816 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
4817 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
4818 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
4819 L4_MABX_B.SFunction1_o6_jd = -250 + ( 0.0078125 * ( ((real_T)
4820 CAN_Sgn.UnsignedSgn) ) );
4821
4822 /* ...... "ACCTargetDetected" (48|2, standard signal, unsigned int, little endian) */
4823 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4824 CAN_Sgn.UnsignedSgn &= 0x00000003;
4825 L4_MABX_B.SFunction1_o7_p = ((real_T) CAN_Sgn.UnsignedSgn);
4826
4827 /* ...... "ACCSystemShutoffWarning" (50|2, standard signal, unsigned int, little endian) */
4828 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4829 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
4830 CAN_Sgn.UnsignedSgn &= 0x00000003;
4831 L4_MABX_B.SFunction1_o8_o1 = ((real_T) CAN_Sgn.UnsignedSgn);
4832
4833 /* ...... "ACCDistanceAlertSignal" (52|2, standard signal, unsigned int, little endian) */
4834 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4835 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
4836 CAN_Sgn.UnsignedSgn &= 0x00000003;
4837 L4_MABX_B.SFunction1_o9_f = ((real_T) CAN_Sgn.UnsignedSgn);
4838
4839 /* ...... "ForwardCollisionWarning" (54|2, standard signal, unsigned int, little endian) */
4840 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4841 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
4842 CAN_Sgn.UnsignedSgn &= 0x00000003;
4843 L4_MABX_B.SFunction1_o10_cg = ((real_T) CAN_Sgn.UnsignedSgn);
4844 }
4845 }
4846 } else {
4847 /* set RX status to 0 because no new message has arrived */
4848 L4_MABX_B.SFunction1_o11_e = 0.0;
4849 }
4850 }
4851 }
4852
4853 /* End of Constant: '<S423>/Constant' */
4854 /* End of Outputs for SubSystem: '<S493>/ACC1_2A_' */
4855
4856 /* DataTypeConversion: '<S493>/Data Type Conversion12' */
4857 L4_MABX_B.ACCDistanceAlertSignal = L4_MABX_B.SFunction1_o9_f;
4858
4859 /* DataTypeConversion: '<S493>/Data Type Conversion13' */
4860 L4_MABX_B.ForwardCollisionWarning = L4_MABX_B.SFunction1_o10_cg;
4861
4862 /* RelationalOperator: '<S478>/Operator' incorporates:
4863 * Constant: '<S421>/Constant'
4864 * Constant: '<S476>/Constant'
4865 */
4866 L4_MABX_B.Operator_po = (L4_MABX_P.Constant_Value_bl ==
4867 L4_MABX_P.Constant_Value_gg);
4868
4869 /* Outputs for Enabled SubSystem: '<S475>/CAN_TYPE1_RX_M1_C1' incorporates:
4870 * EnablePort: '<S477>/Enable'
4871 */
4872 if (L4_MABX_B.Operator_po) {
4873 /* S-Function (rti_commonblock): '<S477>/S-Function1' */
4874 /* This comment workarounds a code generation problem */
4875
4876 /* dSPACE RTICAN RX Message Block: "TPCM_FF_00" Id:485293824 */
4877 {
4878 UInt32 *CAN_Msg;
4879 static dsfloat time_old = 0.0;
4880
4881 /* Read status and timestamp info (previous message) */
4882 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].timestamp !=
4883 time_old) {
4884 /* ... save timestamp info for the calculation of the RX status
4885 during the consecutive sample hit*/
4886 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].
4887 timestamp;
4888
4889 /* ... set the processed flag to one */
4890 L4_MABX_B.SFunction1_o9_cg = 1.0;
4891 L4_MABX_B.SFunction1_o10_mb = (real_T)
4892 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].timestamp;
4893 L4_MABX_B.SFunction1_o11_hc = (real_T)
4894 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].deltatime;
4895 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CECFF00].data;
4896
4897 /* Decode CAN message */
4898 {
4899 {
4900 rtican_Signal_t CAN_Sgn;
4901
4902 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
4903 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
4904 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4905 L4_MABX_B.SFunction1_o1_en = ((real_T) CAN_Sgn.UnsignedSgn);
4906
4907 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
4908 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
4909 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4910 L4_MABX_B.SFunction1_o2_cm = ((real_T) CAN_Sgn.UnsignedSgn);
4911
4912 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
4913 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
4914 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4915 L4_MABX_B.SFunction1_o3_ewi = ((real_T) CAN_Sgn.UnsignedSgn);
4916
4917 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
4918 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
4919 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4920 L4_MABX_B.SFunction1_o4_kw = ((real_T) CAN_Sgn.UnsignedSgn);
4921
4922 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
4923 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
4924 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4925 L4_MABX_B.SFunction1_o5_cp = ((real_T) CAN_Sgn.UnsignedSgn);
4926
4927 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
4928 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
4929 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4930 L4_MABX_B.SFunction1_o6_du = ((real_T) CAN_Sgn.UnsignedSgn);
4931
4932 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
4933 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
4934 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4935 L4_MABX_B.SFunction1_o7_mj = ((real_T) CAN_Sgn.UnsignedSgn);
4936
4937 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
4938 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
4939 CAN_Sgn.UnsignedSgn &= 0x000000FF;
4940 L4_MABX_B.SFunction1_o8_k = ((real_T) CAN_Sgn.UnsignedSgn);
4941 }
4942 }
4943 } else {
4944 /* set RX status to 0 because no new message has arrived */
4945 L4_MABX_B.SFunction1_o9_cg = 0.0;
4946 }
4947 }
4948 }
4949
4950 /* End of Outputs for SubSystem: '<S475>/CAN_TYPE1_RX_M1_C1' */
4951
4952 /* DataTypeConversion: '<S475>/Data Type Conversion' */
4953 PositionFinalLimited = L4_MABX_B.SFunction1_o1_en;
4954 if (PositionFinalLimited < 256.0) {
4955 if (PositionFinalLimited >= 0.0) {
4956 starting_index = (uint8_T)PositionFinalLimited;
4957 } else {
4958 starting_index = 0U;
4959 }
4960 } else {
4961 starting_index = MAX_uint8_T;
4962 }
4963
4964 L4_MABX_B.DataTypeConversion_be = starting_index;
4965
4966 /* End of DataTypeConversion: '<S475>/Data Type Conversion' */
4967
4968 /* DataTypeConversion: '<S475>/Data Type Conversion1' */
4969 PositionFinalLimited = L4_MABX_B.SFunction1_o2_cm;
4970 if (PositionFinalLimited < 256.0) {
4971 if (PositionFinalLimited >= 0.0) {
4972 starting_index = (uint8_T)PositionFinalLimited;
4973 } else {
4974 starting_index = 0U;
4975 }
4976 } else {
4977 starting_index = MAX_uint8_T;
4978 }
4979
4980 L4_MABX_B.DataTypeConversion1_d0 = starting_index;
4981
4982 /* End of DataTypeConversion: '<S475>/Data Type Conversion1' */
4983
4984 /* DataTypeConversion: '<S475>/Data Type Conversion2' */
4985 PositionFinalLimited = L4_MABX_B.SFunction1_o3_ewi;
4986 if (PositionFinalLimited < 256.0) {
4987 if (PositionFinalLimited >= 0.0) {
4988 starting_index = (uint8_T)PositionFinalLimited;
4989 } else {
4990 starting_index = 0U;
4991 }
4992 } else {
4993 starting_index = MAX_uint8_T;
4994 }
4995
4996 L4_MABX_B.DataTypeConversion2_pl = starting_index;
4997
4998 /* End of DataTypeConversion: '<S475>/Data Type Conversion2' */
4999
5000 /* DataTypeConversion: '<S475>/Data Type Conversion3' */
5001 PositionFinalLimited = L4_MABX_B.SFunction1_o4_kw;
5002 if (PositionFinalLimited < 256.0) {
5003 if (PositionFinalLimited >= 0.0) {
5004 starting_index = (uint8_T)PositionFinalLimited;
5005 } else {
5006 starting_index = 0U;
5007 }
5008 } else {
5009 starting_index = MAX_uint8_T;
5010 }
5011
5012 L4_MABX_B.DataTypeConversion3_d = starting_index;
5013
5014 /* End of DataTypeConversion: '<S475>/Data Type Conversion3' */
5015
5016 /* DataTypeConversion: '<S475>/Data Type Conversion4' */
5017 PositionFinalLimited = L4_MABX_B.SFunction1_o5_cp;
5018 if (PositionFinalLimited < 256.0) {
5019 if (PositionFinalLimited >= 0.0) {
5020 starting_index = (uint8_T)PositionFinalLimited;
5021 } else {
5022 starting_index = 0U;
5023 }
5024 } else {
5025 starting_index = MAX_uint8_T;
5026 }
5027
5028 L4_MABX_B.DataTypeConversion4_c = starting_index;
5029
5030 /* End of DataTypeConversion: '<S475>/Data Type Conversion4' */
5031
5032 /* DataTypeConversion: '<S475>/Data Type Conversion5' */
5033 PositionFinalLimited = L4_MABX_B.SFunction1_o6_du;
5034 if (PositionFinalLimited < 256.0) {
5035 if (PositionFinalLimited >= 0.0) {
5036 starting_index = (uint8_T)PositionFinalLimited;
5037 } else {
5038 starting_index = 0U;
5039 }
5040 } else {
5041 starting_index = MAX_uint8_T;
5042 }
5043
5044 L4_MABX_B.DataTypeConversion5_j3 = starting_index;
5045
5046 /* End of DataTypeConversion: '<S475>/Data Type Conversion5' */
5047
5048 /* DataTypeConversion: '<S475>/Data Type Conversion6' */
5049 PositionFinalLimited = L4_MABX_B.SFunction1_o7_mj;
5050 if (PositionFinalLimited < 256.0) {
5051 if (PositionFinalLimited >= 0.0) {
5052 starting_index = (uint8_T)PositionFinalLimited;
5053 } else {
5054 starting_index = 0U;
5055 }
5056 } else {
5057 starting_index = MAX_uint8_T;
5058 }
5059
5060 L4_MABX_B.DataTypeConversion6_e = starting_index;
5061
5062 /* End of DataTypeConversion: '<S475>/Data Type Conversion6' */
5063
5064 /* DataTypeConversion: '<S475>/Data Type Conversion7' */
5065 PositionFinalLimited = L4_MABX_B.SFunction1_o8_k;
5066 if (PositionFinalLimited < 256.0) {
5067 if (PositionFinalLimited >= 0.0) {
5068 starting_index = (uint8_T)PositionFinalLimited;
5069 } else {
5070 starting_index = 0U;
5071 }
5072 } else {
5073 starting_index = MAX_uint8_T;
5074 }
5075
5076 L4_MABX_B.DataTypeConversion7_bg = starting_index;
5077
5078 /* End of DataTypeConversion: '<S475>/Data Type Conversion7' */
5079
5080 /* MultiPortSwitch: '<S421>/Multiport_Switch' */
5081 L4_MABX_B.RawData[0] = L4_MABX_B.DataTypeConversion_be;
5082 L4_MABX_B.RawData[1] = L4_MABX_B.DataTypeConversion1_d0;
5083 L4_MABX_B.RawData[2] = L4_MABX_B.DataTypeConversion2_pl;
5084 L4_MABX_B.RawData[3] = L4_MABX_B.DataTypeConversion3_d;
5085 L4_MABX_B.RawData[4] = L4_MABX_B.DataTypeConversion4_c;
5086 L4_MABX_B.RawData[5] = L4_MABX_B.DataTypeConversion5_j3;
5087 L4_MABX_B.RawData[6] = L4_MABX_B.DataTypeConversion6_e;
5088 L4_MABX_B.RawData[7] = L4_MABX_B.DataTypeConversion7_bg;
5089
5090 /* DataTypeConversion: '<S469>/Data Type Conversion' */
5091 for (i = 0; i < 8; i++) {
5092 L4_MABX_B.DataTypeConversion_kl[i] = L4_MABX_B.RawData[i];
5093 }
5094
5095 /* End of DataTypeConversion: '<S469>/Data Type Conversion' */
5096
5097 /* RelationalOperator: '<S695>/Operator' incorporates:
5098 * Constant: '<S469>/Constant3'
5099 */
5100 L4_MABX_B.Operator_lij = (L4_MABX_B.DataTypeConversion_kl[0] ==
5101 L4_MABX_P.Constant3_Value_po);
5102
5103 /* Outputs for Enabled SubSystem: '<S469>/Decode_TPCM_BAM' incorporates:
5104 * EnablePort: '<S687>/Enable'
5105 */
5106 if (L4_MABX_B.Operator_lij) {
5107 /* SignalConversion: '<S698>/Signal Conversion' */
5108 L4_MABX_B.SPN2556_ControlByte_k = L4_MABX_B.DataTypeConversion_kl[0];
5109
5110 /* DataTypeConversion: '<S699>/Data Type Conversion' */
5111 L4_MABX_B.DataTypeConversion_n = L4_MABX_B.DataTypeConversion_kl[1];
5112
5113 /* DataTypeConversion: '<S699>/Data Type Conversion1' */
5114 L4_MABX_B.DataTypeConversion1_k2 = L4_MABX_B.DataTypeConversion_kl[2];
5115
5116 /* ArithShift: '<S699>/Shift Arithmetic2' */
5117 L4_MABX_B.ShiftArithmetic2_fl = (uint16_T)(L4_MABX_B.DataTypeConversion1_k2 <<
5118 8);
5119
5120 /* S-Function (sfix_bitop): '<S702>/Operator' */
5121 L4_MABX_B.Operator_er = (uint16_T)(L4_MABX_B.DataTypeConversion_n |
5122 L4_MABX_B.ShiftArithmetic2_fl);
5123
5124 /* DataTypeConversion: '<S702>/DataType' */
5125 L4_MABX_B.DataType_le1 = L4_MABX_B.Operator_er;
5126
5127 /* SignalConversion: '<S700>/Signal Conversion' */
5128 L4_MABX_B.SPN2568_TotalNumberOfPackets = L4_MABX_B.DataTypeConversion_kl[3];
5129
5130 /* DataTypeConversion: '<S701>/Data Type Conversion' */
5131 L4_MABX_B.DataTypeConversion_d = L4_MABX_B.DataTypeConversion_kl[5];
5132
5133 /* DataTypeConversion: '<S701>/Data Type Conversion1' */
5134 L4_MABX_B.DataTypeConversion1_l2 = L4_MABX_B.DataTypeConversion_kl[6];
5135
5136 /* DataTypeConversion: '<S701>/Data Type Conversion2' */
5137 L4_MABX_B.DataTypeConversion2_pj = L4_MABX_B.DataTypeConversion_kl[7];
5138
5139 /* ArithShift: '<S701>/Shift Arithmetic1' */
5140 L4_MABX_B.ShiftArithmetic1_m = L4_MABX_B.DataTypeConversion1_l2 << 8;
5141
5142 /* ArithShift: '<S701>/Shift Arithmetic2' */
5143 L4_MABX_B.ShiftArithmetic2_o = L4_MABX_B.DataTypeConversion2_pj << 16;
5144
5145 /* S-Function (sfix_bitop): '<S703>/Operator' */
5146 L4_MABX_B.Operator_ah = L4_MABX_B.DataTypeConversion_d |
5147 L4_MABX_B.ShiftArithmetic1_m | L4_MABX_B.ShiftArithmetic2_o;
5148
5149 /* DataTypeConversion: '<S703>/DataType' */
5150 L4_MABX_B.DataType_ef = L4_MABX_B.Operator_ah;
5151 }
5152
5153 /* End of Outputs for SubSystem: '<S469>/Decode_TPCM_BAM' */
5154
5155 /* RelationalOperator: '<S487>/Operator' incorporates:
5156 * Constant: '<S422>/Constant'
5157 * Constant: '<S485>/Constant'
5158 */
5159 L4_MABX_B.Operator_he = (L4_MABX_P.Constant_Value_b4 ==
5160 L4_MABX_P.Constant_Value_h0);
5161
5162 /* Outputs for Enabled SubSystem: '<S484>/CAN_TYPE1_RX_M1_C1' incorporates:
5163 * EnablePort: '<S486>/Enable'
5164 */
5165 if (L4_MABX_B.Operator_he) {
5166 /* S-Function (rti_commonblock): '<S486>/S-Function1' */
5167 /* This comment workarounds a code generation problem */
5168
5169 /* dSPACE RTICAN RX Message Block: "TPDT_FF_00" Id:485228288 */
5170 {
5171 UInt32 *CAN_Msg;
5172 static dsfloat time_old = 0.0;
5173
5174 /* Read status and timestamp info (previous message) */
5175 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].timestamp !=
5176 time_old) {
5177 /* ... save timestamp info for the calculation of the RX status
5178 during the consecutive sample hit*/
5179 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].
5180 timestamp;
5181
5182 /* ... set the processed flag to one */
5183 L4_MABX_B.SFunction1_o9_kq = 1.0;
5184 L4_MABX_B.SFunction1_o10_eo = (real_T)
5185 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].timestamp;
5186 L4_MABX_B.SFunction1_o11_k = (real_T)
5187 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].deltatime;
5188 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x1CEBFF00].data;
5189
5190 /* Decode CAN message */
5191 {
5192 {
5193 rtican_Signal_t CAN_Sgn;
5194
5195 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
5196 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
5197 CAN_Sgn.UnsignedSgn &= 0x000000FF;
5198 L4_MABX_B.SFunction1_o1_do = ((real_T) CAN_Sgn.UnsignedSgn);
5199
5200 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
5201 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
5202 CAN_Sgn.UnsignedSgn &= 0x000000FF;
5203 L4_MABX_B.SFunction1_o2_m0 = ((real_T) CAN_Sgn.UnsignedSgn);
5204
5205 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
5206 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
5207 CAN_Sgn.UnsignedSgn &= 0x000000FF;
5208 L4_MABX_B.SFunction1_o3_lm = ((real_T) CAN_Sgn.UnsignedSgn);
5209
5210 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
5211 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
5212 CAN_Sgn.UnsignedSgn &= 0x000000FF;
5213 L4_MABX_B.SFunction1_o4_p5 = ((real_T) CAN_Sgn.UnsignedSgn);
5214
5215 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
5216 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
5217 CAN_Sgn.UnsignedSgn &= 0x000000FF;
5218 L4_MABX_B.SFunction1_o5_ej = ((real_T) CAN_Sgn.UnsignedSgn);
5219
5220 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
5221 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
5222 CAN_Sgn.UnsignedSgn &= 0x000000FF;
5223 L4_MABX_B.SFunction1_o6_p3d = ((real_T) CAN_Sgn.UnsignedSgn);
5224
5225 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
5226 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
5227 CAN_Sgn.UnsignedSgn &= 0x000000FF;
5228 L4_MABX_B.SFunction1_o7_k4 = ((real_T) CAN_Sgn.UnsignedSgn);
5229
5230 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
5231 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
5232 CAN_Sgn.UnsignedSgn &= 0x000000FF;
5233 L4_MABX_B.SFunction1_o8_n = ((real_T) CAN_Sgn.UnsignedSgn);
5234 }
5235 }
5236 } else {
5237 /* set RX status to 0 because no new message has arrived */
5238 L4_MABX_B.SFunction1_o9_kq = 0.0;
5239 }
5240 }
5241 }
5242
5243 /* End of Outputs for SubSystem: '<S484>/CAN_TYPE1_RX_M1_C1' */
5244
5245 /* DataTypeConversion: '<S484>/Data Type Conversion' */
5246 PositionFinalLimited = L4_MABX_B.SFunction1_o1_do;
5247 if (PositionFinalLimited < 256.0) {
5248 if (PositionFinalLimited >= 0.0) {
5249 starting_index = (uint8_T)PositionFinalLimited;
5250 } else {
5251 starting_index = 0U;
5252 }
5253 } else {
5254 starting_index = MAX_uint8_T;
5255 }
5256
5257 L4_MABX_B.DataTypeConversion_l4 = starting_index;
5258
5259 /* End of DataTypeConversion: '<S484>/Data Type Conversion' */
5260
5261 /* DataTypeConversion: '<S484>/Data Type Conversion1' */
5262 PositionFinalLimited = L4_MABX_B.SFunction1_o2_m0;
5263 if (PositionFinalLimited < 256.0) {
5264 if (PositionFinalLimited >= 0.0) {
5265 starting_index = (uint8_T)PositionFinalLimited;
5266 } else {
5267 starting_index = 0U;
5268 }
5269 } else {
5270 starting_index = MAX_uint8_T;
5271 }
5272
5273 L4_MABX_B.DataTypeConversion1_hl = starting_index;
5274
5275 /* End of DataTypeConversion: '<S484>/Data Type Conversion1' */
5276
5277 /* DataTypeConversion: '<S484>/Data Type Conversion2' */
5278 PositionFinalLimited = L4_MABX_B.SFunction1_o3_lm;
5279 if (PositionFinalLimited < 256.0) {
5280 if (PositionFinalLimited >= 0.0) {
5281 starting_index = (uint8_T)PositionFinalLimited;
5282 } else {
5283 starting_index = 0U;
5284 }
5285 } else {
5286 starting_index = MAX_uint8_T;
5287 }
5288
5289 L4_MABX_B.DataTypeConversion2_pj3 = starting_index;
5290
5291 /* End of DataTypeConversion: '<S484>/Data Type Conversion2' */
5292
5293 /* DataTypeConversion: '<S484>/Data Type Conversion3' */
5294 PositionFinalLimited = L4_MABX_B.SFunction1_o4_p5;
5295 if (PositionFinalLimited < 256.0) {
5296 if (PositionFinalLimited >= 0.0) {
5297 starting_index = (uint8_T)PositionFinalLimited;
5298 } else {
5299 starting_index = 0U;
5300 }
5301 } else {
5302 starting_index = MAX_uint8_T;
5303 }
5304
5305 L4_MABX_B.DataTypeConversion3_i = starting_index;
5306
5307 /* End of DataTypeConversion: '<S484>/Data Type Conversion3' */
5308
5309 /* DataTypeConversion: '<S484>/Data Type Conversion4' */
5310 PositionFinalLimited = L4_MABX_B.SFunction1_o5_ej;
5311 if (PositionFinalLimited < 256.0) {
5312 if (PositionFinalLimited >= 0.0) {
5313 starting_index = (uint8_T)PositionFinalLimited;
5314 } else {
5315 starting_index = 0U;
5316 }
5317 } else {
5318 starting_index = MAX_uint8_T;
5319 }
5320
5321 L4_MABX_B.DataTypeConversion4_g1 = starting_index;
5322
5323 /* End of DataTypeConversion: '<S484>/Data Type Conversion4' */
5324
5325 /* DataTypeConversion: '<S484>/Data Type Conversion5' */
5326 PositionFinalLimited = L4_MABX_B.SFunction1_o6_p3d;
5327 if (PositionFinalLimited < 256.0) {
5328 if (PositionFinalLimited >= 0.0) {
5329 starting_index = (uint8_T)PositionFinalLimited;
5330 } else {
5331 starting_index = 0U;
5332 }
5333 } else {
5334 starting_index = MAX_uint8_T;
5335 }
5336
5337 L4_MABX_B.DataTypeConversion5_g = starting_index;
5338
5339 /* End of DataTypeConversion: '<S484>/Data Type Conversion5' */
5340
5341 /* DataTypeConversion: '<S484>/Data Type Conversion6' */
5342 PositionFinalLimited = L4_MABX_B.SFunction1_o7_k4;
5343 if (PositionFinalLimited < 256.0) {
5344 if (PositionFinalLimited >= 0.0) {
5345 starting_index = (uint8_T)PositionFinalLimited;
5346 } else {
5347 starting_index = 0U;
5348 }
5349 } else {
5350 starting_index = MAX_uint8_T;
5351 }
5352
5353 L4_MABX_B.DataTypeConversion6_d = starting_index;
5354
5355 /* End of DataTypeConversion: '<S484>/Data Type Conversion6' */
5356
5357 /* DataTypeConversion: '<S484>/Data Type Conversion7' */
5358 PositionFinalLimited = L4_MABX_B.SFunction1_o8_n;
5359 if (PositionFinalLimited < 256.0) {
5360 if (PositionFinalLimited >= 0.0) {
5361 starting_index = (uint8_T)PositionFinalLimited;
5362 } else {
5363 starting_index = 0U;
5364 }
5365 } else {
5366 starting_index = MAX_uint8_T;
5367 }
5368
5369 L4_MABX_B.DataTypeConversion7_o4 = starting_index;
5370
5371 /* End of DataTypeConversion: '<S484>/Data Type Conversion7' */
5372
5373 /* MultiPortSwitch: '<S422>/Multiport_Switch' */
5374 L4_MABX_B.RawData_l[0] = L4_MABX_B.DataTypeConversion_l4;
5375 L4_MABX_B.RawData_l[1] = L4_MABX_B.DataTypeConversion1_hl;
5376 L4_MABX_B.RawData_l[2] = L4_MABX_B.DataTypeConversion2_pj3;
5377 L4_MABX_B.RawData_l[3] = L4_MABX_B.DataTypeConversion3_i;
5378 L4_MABX_B.RawData_l[4] = L4_MABX_B.DataTypeConversion4_g1;
5379 L4_MABX_B.RawData_l[5] = L4_MABX_B.DataTypeConversion5_g;
5380 L4_MABX_B.RawData_l[6] = L4_MABX_B.DataTypeConversion6_d;
5381 L4_MABX_B.RawData_l[7] = L4_MABX_B.DataTypeConversion7_o4;
5382
5383 /* DataTypeConversion: '<S470>/Data Type Conversion' */
5384 for (i = 0; i < 8; i++) {
5385 L4_MABX_B.DataTypeConversion_e[i] = L4_MABX_B.RawData_l[i];
5386 }
5387
5388 /* End of DataTypeConversion: '<S470>/Data Type Conversion' */
5389
5390 /* S-Function (rti_commonblock): '<S848>/S-Function1' */
5391
5392 /* This comment workarounds a code generation problem */
5393
5394 /* End of Outputs for S-Function (rti_commonblock): '<S848>/S-Function1' */
5395
5396 /* RateTransition: '<S417>/Rate Transition' */
5397 switch (L4_MABX_DW.RateTransition_write_buf) {
5398 case 0:
5399 L4_MABX_DW.RateTransition_read_buf = 1;
5400 break;
5401
5402 case 1:
5403 L4_MABX_DW.RateTransition_read_buf = 0;
5404 break;
5405
5406 default:
5407 L4_MABX_DW.RateTransition_read_buf = L4_MABX_DW.RateTransition_last_buf_wr;
5408 break;
5409 }
5410
5411 if (L4_MABX_DW.RateTransition_read_buf != 0) {
5412 GLB_Absolute_Timestamp = L4_MABX_DW.RateTransition_Buffer1;
5413 } else {
5414 GLB_Absolute_Timestamp = L4_MABX_DW.RateTransition_Buffer0;
5415 }
5416
5417 L4_MABX_DW.RateTransition_read_buf = -1;
5418
5419 /* End of RateTransition: '<S417>/Rate Transition' */
5420
5421 /* DataTypeConversion: '<S484>/Data Type Conversion8' */
5422 L4_MABX_B.RX_status = (L4_MABX_B.SFunction1_o9_kq != 0.0);
5423
5424 /* MultiPortSwitch: '<S422>/Multiport_Switch' */
5425 L4_MABX_B.RX_status_e = L4_MABX_B.RX_status;
5426
5427 /* RelationalOperator: '<S522>/Operator' incorporates:
5428 * Constant: '<S436>/Constant2'
5429 */
5430 L4_MABX_B.Operator_dj = (L4_MABX_B.DataType_ef == L4_MABX_P.Constant2_Value_gm);
5431
5432 /* Logic: '<S436>/Logical Operator' */
5433 L4_MABX_B.LogicalOperator_n4 = (L4_MABX_B.RX_status_e && L4_MABX_B.Operator_dj);
5434
5435 /* Outputs for Enabled SubSystem: '<S436>/CAN_RX_EC1_00' incorporates:
5436 * EnablePort: '<S520>/Enable'
5437 */
5438 if (L4_MABX_B.LogicalOperator_n4) {
5439 /* UnitDelay: '<S520>/Unit Delay' */
5440 for (i = 0; i < 39; i++) {
5441 L4_MABX_B.UnitDelay_ca[i] = L4_MABX_DW.UnitDelay_DSTATE_em[i];
5442 }
5443
5444 /* End of UnitDelay: '<S520>/Unit Delay' */
5445
5446 /* MATLAB Function: '<S520>/serialize_tpdt' */
5447 /* MATLAB Function 'INPUTS_PIC_KW/CAN_PIC_KW/CAN_RX_EC1_00/CAN_RX_EC1_00/serialize_tpdt': '<S524>:1' */
5448 /* '<S524>:1:9' */
5449 if (L4_MABX_B.DataTypeConversion_e[0] > 1) {
5450 /* '<S524>:1:6' */
5451 /* '<S524>:1:7' */
5452 for (i = 0; i < 39; i++) {
5453 L4_MABX_B.Data_i[i] = L4_MABX_B.UnitDelay_ca[i];
5454 }
5455 } else {
5456 /* '<S524>:1:9' */
5457 for (i = 0; i < 39; i++) {
5458 L4_MABX_B.Data_i[i] = MAX_uint8_T;
5459 }
5460 }
5461
5462 /* '<S524>:1:11' */
5463 i = (int32_T)(7U * L4_MABX_B.DataTypeConversion_e[0]);
5464 if ((uint32_T)i > 255U) {
5465 i = 255;
5466 }
5467
5468 tmp = i - 6U;
5469 if (tmp > (uint32_T)i) {
5470 tmp = 0U;
5471 }
5472
5473 i = (int32_T)tmp;
5474 starting_index = (uint8_T)i;
5475
5476 /* '<S524>:1:12' */
5477 L4_MABX_B.Data_i[starting_index - 1] = L4_MABX_B.DataTypeConversion_e[1];
5478 L4_MABX_B.Data_i[starting_index] = L4_MABX_B.DataTypeConversion_e[2];
5479 L4_MABX_B.Data_i[starting_index + 1] = L4_MABX_B.DataTypeConversion_e[3];
5480 L4_MABX_B.Data_i[starting_index + 2] = L4_MABX_B.DataTypeConversion_e[4];
5481 L4_MABX_B.Data_i[starting_index + 3] = L4_MABX_B.DataTypeConversion_e[5];
5482 L4_MABX_B.Data_i[starting_index + 4] = L4_MABX_B.DataTypeConversion_e[6];
5483 L4_MABX_B.Data_i[starting_index + 5] = L4_MABX_B.DataTypeConversion_e[7];
5484
5485 /* '<S524>:1:13' */
5486 L4_MABX_B.RX_status_di = (L4_MABX_B.DataTypeConversion_e[0] ==
5487 L4_MABX_B.SPN2568_TotalNumberOfPackets);
5488
5489 /* End of MATLAB Function: '<S520>/serialize_tpdt' */
5490
5491 /* Outputs for Enabled SubSystem: '<S520>/Decode' incorporates:
5492 * EnablePort: '<S523>/Enable'
5493 */
5494 if (L4_MABX_B.RX_status_di) {
5495 /* Inport: '<S523>/Inport' */
5496 for (i = 0; i < 39; i++) {
5497 L4_MABX_B.Inport_j[i] = L4_MABX_B.Data_i[i];
5498 }
5499
5500 /* End of Inport: '<S523>/Inport' */
5501
5502 /* Inport: '<S523>/timeStamp' */
5503 L4_MABX_B.timeStamp_c = GLB_Absolute_Timestamp;
5504
5505 /* UnitDelay: '<S523>/Unit_Delay' */
5506 L4_MABX_B.Unit_Delay_n = L4_MABX_DW.Unit_Delay_DSTATE_a;
5507
5508 /* Sum: '<S523>/Subtract' */
5509 L4_MABX_B.Subtract_f3 = (real32_T)(L4_MABX_B.timeStamp_c -
5510 L4_MABX_B.Unit_Delay_n);
5511 }
5512
5513 /* End of Outputs for SubSystem: '<S520>/Decode' */
5514 }
5515
5516 /* End of Outputs for SubSystem: '<S436>/CAN_RX_EC1_00' */
5517
5518 /* DataTypeConversion: '<S521>/Data Type Conversion' */
5519 for (i = 0; i < 39; i++) {
5520 L4_MABX_B.DataTypeConversion_c0[i] = L4_MABX_B.Inport_j[i];
5521 }
5522
5523 /* End of DataTypeConversion: '<S521>/Data Type Conversion' */
5524
5525 /* DataTypeConversion: '<S532>/Data Type Conversion' */
5526 L4_MABX_B.DataTypeConversion_lc = L4_MABX_B.DataTypeConversion_c0[19];
5527
5528 /* DataTypeConversion: '<S532>/Data Type Conversion1' */
5529 L4_MABX_B.DataTypeConversion1_hc = L4_MABX_B.DataTypeConversion_c0[20];
5530
5531 /* ArithShift: '<S532>/Shift Arithmetic' */
5532 L4_MABX_B.ShiftArithmetic = (uint16_T)(L4_MABX_B.DataTypeConversion1_hc << 8);
5533
5534 /* S-Function (sfix_bitop): '<S557>/Operator' */
5535 L4_MABX_B.Operator_im = (uint16_T)(L4_MABX_B.DataTypeConversion_lc |
5536 L4_MABX_B.ShiftArithmetic);
5537
5538 /* DataTypeConversion: '<S557>/DataType' */
5539 L4_MABX_B.DataType_jt = L4_MABX_B.Operator_im;
5540
5541 /* DataTypeConversion: '<S532>/Data Type Conversion2' */
5542 L4_MABX_B.SPN544_EngineReferenceTorque = L4_MABX_B.DataType_jt;
5543
5544 /* Outputs for Enabled SubSystem: '<S642>/VDC1_0B_' incorporates:
5545 * EnablePort: '<S643>/Enable'
5546 */
5547 /* Constant: '<S456>/Constant' */
5548 if (L4_MABX_P.Constant_Value_bj) {
5549 /* S-Function (rti_commonblock): '<S643>/S-Function1' */
5550 /* This comment workarounds a code generation problem */
5551
5552 /* dSPACE RTICAN RX Message Block: "VDC1_0B" Id:419319563 */
5553 {
5554 UInt32 *CAN_Msg;
5555 static dsfloat time_old = 0.0;
5556
5557 /* Read status and timestamp info (previous message) */
5558 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].timestamp !=
5559 time_old) {
5560 /* ... save timestamp info for the calculation of the RX status
5561 during the consecutive sample hit*/
5562 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].
5563 timestamp;
5564
5565 /* ... set the processed flag to one */
5566 L4_MABX_B.SFunction1_o8_a = 1.0;
5567 L4_MABX_B.SFunction1_o9_j = (real_T)
5568 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].timestamp;
5569 L4_MABX_B.SFunction1_o10 = (real_T)
5570 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].deltatime;
5571 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FE4F0B].data;
5572
5573 /* Decode CAN message */
5574 {
5575 {
5576 rtican_Signal_t CAN_Sgn;
5577
5578 /* ...... "VDCInformationSignal" (0|2, standard signal, unsigned int, little endian) */
5579 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
5580 CAN_Sgn.UnsignedSgn &= 0x00000003;
5581 L4_MABX_B.SFunction1_o1_ol = ((real_T) CAN_Sgn.UnsignedSgn);
5582
5583 /* ...... "VDCFullyOperational" (2|2, standard signal, unsigned int, little endian) */
5584 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
5585 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
5586 CAN_Sgn.UnsignedSgn &= 0x00000003;
5587 L4_MABX_B.SFunction1_o2_dm = ((real_T) CAN_Sgn.UnsignedSgn);
5588
5589 /* ...... "VDCBrakeLightRq" (4|2, standard signal, unsigned int, little endian) */
5590 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
5591 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
5592 CAN_Sgn.UnsignedSgn &= 0x00000003;
5593 L4_MABX_B.SFunction1_o3_na = ((real_T) CAN_Sgn.UnsignedSgn);
5594
5595 /* ...... "ROPEngCtrlActive" (8|2, standard signal, unsigned int, little endian) */
5596 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
5597 CAN_Sgn.UnsignedSgn &= 0x00000003;
5598 L4_MABX_B.SFunction1_o4_o = ((real_T) CAN_Sgn.UnsignedSgn);
5599
5600 /* ...... "ROPBrakeCtrlActive" (10|2, standard signal, unsigned int, little endian) */
5601 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
5602 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
5603 CAN_Sgn.UnsignedSgn &= 0x00000003;
5604 L4_MABX_B.SFunction1_o5_m = ((real_T) CAN_Sgn.UnsignedSgn);
5605
5606 /* ...... "YCEngCtrlActive" (12|2, standard signal, unsigned int, little endian) */
5607 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
5608 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
5609 CAN_Sgn.UnsignedSgn &= 0x00000003;
5610 L4_MABX_B.SFunction1_o6_n = ((real_T) CAN_Sgn.UnsignedSgn);
5611
5612 /* ...... "YCBrakeCtrlActive" (14|2, standard signal, unsigned int, little endian) */
5613 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
5614 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
5615 CAN_Sgn.UnsignedSgn &= 0x00000003;
5616 L4_MABX_B.SFunction1_o7_f = ((real_T) CAN_Sgn.UnsignedSgn);
5617 }
5618 }
5619 } else {
5620 /* set RX status to 0 because no new message has arrived */
5621 L4_MABX_B.SFunction1_o8_a = 0.0;
5622 }
5623 }
5624 }
5625
5626 /* End of Constant: '<S456>/Constant' */
5627 /* End of Outputs for SubSystem: '<S642>/VDC1_0B_' */
5628
5629 /* Outputs for Enabled SubSystem: '<S644>/VDC2_0B1' incorporates:
5630 * EnablePort: '<S645>/Enable'
5631 */
5632 /* Constant: '<S457>/Constant' */
5633 if (L4_MABX_P.Constant_Value_hcn) {
5634 /* S-Function (rti_commonblock): '<S645>/S-Function1' */
5635 /* This comment workarounds a code generation problem */
5636
5637 /* dSPACE RTICAN RX Message Block: "VDC2_0B" Id:418384139 */
5638 {
5639 UInt32 *CAN_Msg;
5640 static dsfloat time_old = 0.0;
5641
5642 /* Read status and timestamp info (previous message) */
5643 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].timestamp !=
5644 time_old) {
5645 /* ... save timestamp info for the calculation of the RX status
5646 during the consecutive sample hit*/
5647 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].
5648 timestamp;
5649
5650 /* ... set the processed flag to one */
5651 L4_MABX_B.SFunction1_o7_c = 1.0;
5652 L4_MABX_B.SFunction1_o8_c = (real_T)
5653 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].timestamp;
5654 L4_MABX_B.SFunction1_o9 = (real_T)
5655 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].deltatime;
5656 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0090B].data;
5657
5658 /* Decode CAN message */
5659 {
5660 {
5661 rtican_Signal_t CAN_Sgn;
5662
5663 /* ...... "SteerWheelAngle" (0|16, standard signal, unsigned int, little endian) */
5664 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
5665 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
5666 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
5667 SteerWheelAngle = -31.374 + ( 0.0009765625 * ( ((real_T)
5668 CAN_Sgn.UnsignedSgn) ) );
5669
5670 /* ...... "SteerWheelTurnCounter" (16|6, standard signal, unsigned int, little endian) */
5671 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
5672 CAN_Sgn.UnsignedSgn &= 0x0000003F;
5673 L4_MABX_B.SFunction1_o2_i = -32 + ( ((real_T) CAN_Sgn.UnsignedSgn) );
5674
5675 /* ...... "SteerWheelAngleSensorType" (22|2, standard signal, unsigned int, little endian) */
5676 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
5677 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
5678 CAN_Sgn.UnsignedSgn &= 0x00000003;
5679 L4_MABX_B.SFunction1_o3_a0 = ((real_T) CAN_Sgn.UnsignedSgn);
5680
5681 /* ...... "YawRate" (24|16, standard signal, unsigned int, little endian) */
5682 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
5683 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
5684 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
5685 YawRate = -3.92 + ( 0.0001220703125 * ( ((real_T)
5686 CAN_Sgn.UnsignedSgn) ) );
5687
5688 /* ...... "LateralAcceleration" (40|16, standard signal, unsigned int, little endian) */
5689 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
5690 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
5691 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
5692 L4_MABX_B.SFunction1_o5_f = -15.687 + ( 0.00048828125 * ( ((real_T)
5693 CAN_Sgn.UnsignedSgn) ) );
5694
5695 /* ...... "LongitudinalAcceleration" (56|8, standard signal, unsigned int, little endian) */
5696 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
5697 CAN_Sgn.UnsignedSgn &= 0x000000FF;
5698 SPN1810_LongitudinalAcceleration = -12.5 + ( 0.1 * ( ((real_T)
5699 CAN_Sgn.UnsignedSgn) ) );
5700 }
5701 }
5702 } else {
5703 /* set RX status to 0 because no new message has arrived */
5704 L4_MABX_B.SFunction1_o7_c = 0.0;
5705 }
5706 }
5707 }
5708
5709 /* End of Constant: '<S457>/Constant' */
5710 /* End of Outputs for SubSystem: '<S644>/VDC2_0B1' */
5711
5712 /* UnitDelay: '<S649>/Unit_Delay3' */
5713 L4_MABX_B.Unit_Delay3 = L4_MABX_DW.Unit_Delay3_DSTATE;
5714
5715 /* RelationalOperator: '<S650>/Operator' incorporates:
5716 * Constant: '<S459>/Constant2'
5717 */
5718 L4_MABX_B.Operator_gm = (L4_MABX_B.DataType_ef == L4_MABX_P.Constant2_Value_ps);
5719
5720 /* Logic: '<S459>/Logical Operator' */
5721 L4_MABX_B.LogicalOperator_b = (L4_MABX_B.RX_status_e && L4_MABX_B.Operator_gm);
5722
5723 /* Outputs for Enabled SubSystem: '<S459>/CAN_RX_VI_00' incorporates:
5724 * EnablePort: '<S648>/Enable'
5725 */
5726 if (L4_MABX_B.LogicalOperator_b) {
5727 /* UnitDelay: '<S648>/Unit Delay' */
5728 for (i = 0; i < 17; i++) {
5729 L4_MABX_B.UnitDelay_b2[i] = L4_MABX_DW.UnitDelay_DSTATE_a[i];
5730 }
5731
5732 /* End of UnitDelay: '<S648>/Unit Delay' */
5733
5734 /* MATLAB Function: '<S648>/serialize_tpdt' */
5735 /* MATLAB Function 'INPUTS_PIC_KW/CAN_PIC_KW/CAN_RX_VI_00/CAN_RX_VI_00/serialize_tpdt': '<S652>:1' */
5736 /* '<S652>:1:9' */
5737 if (L4_MABX_B.DataTypeConversion_e[0] > 1) {
5738 /* '<S652>:1:6' */
5739 /* '<S652>:1:7' */
5740 for (i = 0; i < 17; i++) {
5741 L4_MABX_B.Data[i] = L4_MABX_B.UnitDelay_b2[i];
5742 }
5743 } else {
5744 /* '<S652>:1:9' */
5745 for (i = 0; i < 17; i++) {
5746 L4_MABX_B.Data[i] = MAX_uint8_T;
5747 }
5748 }
5749
5750 /* '<S652>:1:11' */
5751 i = (int32_T)(7U * L4_MABX_B.DataTypeConversion_e[0]);
5752 if ((uint32_T)i > 255U) {
5753 i = 255;
5754 }
5755
5756 tmp = i - 6U;
5757 if (tmp > (uint32_T)i) {
5758 tmp = 0U;
5759 }
5760
5761 i = (int32_T)tmp;
5762 starting_index = (uint8_T)i;
5763
5764 /* '<S652>:1:12' */
5765 L4_MABX_B.Data[starting_index - 1] = L4_MABX_B.DataTypeConversion_e[1];
5766 L4_MABX_B.Data[starting_index] = L4_MABX_B.DataTypeConversion_e[2];
5767 L4_MABX_B.Data[starting_index + 1] = L4_MABX_B.DataTypeConversion_e[3];
5768 L4_MABX_B.Data[starting_index + 2] = L4_MABX_B.DataTypeConversion_e[4];
5769 L4_MABX_B.Data[starting_index + 3] = L4_MABX_B.DataTypeConversion_e[5];
5770 L4_MABX_B.Data[starting_index + 4] = L4_MABX_B.DataTypeConversion_e[6];
5771 L4_MABX_B.Data[starting_index + 5] = L4_MABX_B.DataTypeConversion_e[7];
5772
5773 /* '<S652>:1:13' */
5774 L4_MABX_B.RX_status_ez = (L4_MABX_B.DataTypeConversion_e[0] ==
5775 L4_MABX_B.SPN2568_TotalNumberOfPackets);
5776
5777 /* End of MATLAB Function: '<S648>/serialize_tpdt' */
5778
5779 /* Outputs for Enabled SubSystem: '<S648>/Decode' incorporates:
5780 * EnablePort: '<S651>/Enable'
5781 */
5782 if (L4_MABX_B.RX_status_ez) {
5783 /* Inport: '<S651>/Inport' */
5784 for (i = 0; i < 17; i++) {
5785 L4_MABX_B.Inport[i] = L4_MABX_B.Data[i];
5786 }
5787
5788 /* End of Inport: '<S651>/Inport' */
5789
5790 /* Inport: '<S651>/timeStamp' */
5791 L4_MABX_B.timeStamp = GLB_Absolute_Timestamp;
5792
5793 /* UnitDelay: '<S651>/Unit_Delay' */
5794 L4_MABX_B.Unit_Delay_p = L4_MABX_DW.Unit_Delay_DSTATE_e;
5795
5796 /* Sum: '<S651>/Subtract' */
5797 L4_MABX_B.Subtract_h3 = (real32_T)(L4_MABX_B.timeStamp -
5798 L4_MABX_B.Unit_Delay_p);
5799 }
5800
5801 /* End of Outputs for SubSystem: '<S648>/Decode' */
5802 }
5803
5804 /* End of Outputs for SubSystem: '<S459>/CAN_RX_VI_00' */
5805
5806 /* DataTypeConversion: '<S649>/Data Type Conversion' */
5807 L4_MABX_B.DataTypeConversion_ld = L4_MABX_B.Inport[0];
5808
5809 /* DataTypeConversion: '<S649>/Data Type Conversion1' */
5810 L4_MABX_B.DataTypeConversion1_e1 = L4_MABX_B.Inport[1];
5811
5812 /* DataTypeConversion: '<S649>/Data Type Conversion2' */
5813 L4_MABX_B.DataTypeConversion2_oi = L4_MABX_B.Inport[2];
5814
5815 /* DataTypeConversion: '<S649>/Data Type Conversion3' */
5816 L4_MABX_B.DataTypeConversion3_f = L4_MABX_B.Inport[3];
5817
5818 /* DataTypeConversion: '<S649>/Data Type Conversion4' */
5819 L4_MABX_B.DataTypeConversion4_j = L4_MABX_B.Inport[4];
5820
5821 /* DataTypeConversion: '<S649>/Data Type Conversion5' */
5822 L4_MABX_B.DataTypeConversion5_n = L4_MABX_B.Inport[5];
5823
5824 /* DataTypeConversion: '<S649>/Data Type Conversion6' */
5825 L4_MABX_B.DataTypeConversion6_d4 = L4_MABX_B.Inport[6];
5826
5827 /* DataTypeConversion: '<S649>/Data Type Conversion7' */
5828 L4_MABX_B.DataTypeConversion7_e1 = L4_MABX_B.Inport[7];
5829
5830 /* DataTypeConversion: '<S649>/Data Type Conversion8' */
5831 L4_MABX_B.DataTypeConversion8_fx = L4_MABX_B.Inport[8];
5832
5833 /* DataTypeConversion: '<S649>/Data Type Conversion9' */
5834 L4_MABX_B.DataTypeConversion9_b = L4_MABX_B.Inport[9];
5835
5836 /* DataTypeConversion: '<S649>/Data Type Conversion10' */
5837 L4_MABX_B.DataTypeConversion10_l = L4_MABX_B.Inport[10];
5838
5839 /* DataTypeConversion: '<S649>/Data Type Conversion11' */
5840 L4_MABX_B.DataTypeConversion11_l = L4_MABX_B.Inport[11];
5841
5842 /* DataTypeConversion: '<S649>/Data Type Conversion12' */
5843 L4_MABX_B.DataTypeConversion12 = L4_MABX_B.Inport[12];
5844
5845 /* DataTypeConversion: '<S649>/Data Type Conversion14' */
5846 L4_MABX_B.DataTypeConversion14_f = L4_MABX_B.Inport[13];
5847
5848 /* DataTypeConversion: '<S649>/Data Type Conversion13' */
5849 L4_MABX_B.DataTypeConversion13_n = L4_MABX_B.Inport[14];
5850
5851 /* DataTypeConversion: '<S649>/Data Type Conversion15' */
5852 L4_MABX_B.DataTypeConversion15_a = L4_MABX_B.Inport[15];
5853
5854 /* DataTypeConversion: '<S649>/Data Type Conversion16' */
5855 L4_MABX_B.DataTypeConversion16_e = L4_MABX_B.Inport[16];
5856
5857 /* RelationalOperator: '<S649>/Relational Operator1' incorporates:
5858 * Constant: '<S649>/TRUCK_1571_VIN_CPV'
5859 */
5860 L4_MABX_B.RelationalOperator1_g1[0] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[0]
5861 != L4_MABX_B.DataTypeConversion_ld);
5862 L4_MABX_B.RelationalOperator1_g1[1] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[1]
5863 != L4_MABX_B.DataTypeConversion1_e1);
5864 L4_MABX_B.RelationalOperator1_g1[2] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[2]
5865 != L4_MABX_B.DataTypeConversion2_oi);
5866 L4_MABX_B.RelationalOperator1_g1[3] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[3]
5867 != L4_MABX_B.DataTypeConversion3_f);
5868 L4_MABX_B.RelationalOperator1_g1[4] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[4]
5869 != L4_MABX_B.DataTypeConversion4_j);
5870 L4_MABX_B.RelationalOperator1_g1[5] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[5]
5871 != L4_MABX_B.DataTypeConversion5_n);
5872 L4_MABX_B.RelationalOperator1_g1[6] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[6]
5873 != L4_MABX_B.DataTypeConversion6_d4);
5874 L4_MABX_B.RelationalOperator1_g1[7] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[7]
5875 != L4_MABX_B.DataTypeConversion7_e1);
5876 L4_MABX_B.RelationalOperator1_g1[8] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[8]
5877 != L4_MABX_B.DataTypeConversion8_fx);
5878 L4_MABX_B.RelationalOperator1_g1[9] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[9]
5879 != L4_MABX_B.DataTypeConversion9_b);
5880 L4_MABX_B.RelationalOperator1_g1[10] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[10]
5881 != L4_MABX_B.DataTypeConversion10_l);
5882 L4_MABX_B.RelationalOperator1_g1[11] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[11]
5883 != L4_MABX_B.DataTypeConversion11_l);
5884 L4_MABX_B.RelationalOperator1_g1[12] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[12]
5885 != L4_MABX_B.DataTypeConversion12);
5886 L4_MABX_B.RelationalOperator1_g1[13] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[13]
5887 != L4_MABX_B.DataTypeConversion14_f);
5888 L4_MABX_B.RelationalOperator1_g1[14] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[14]
5889 != L4_MABX_B.DataTypeConversion13_n);
5890 L4_MABX_B.RelationalOperator1_g1[15] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[15]
5891 != L4_MABX_B.DataTypeConversion15_a);
5892 L4_MABX_B.RelationalOperator1_g1[16] = (L4_MABX_P.TRUCK_1571_VIN_CPV_Value[16]
5893 != L4_MABX_B.DataTypeConversion16_e);
5894
5895 /* Sum: '<S649>/Add' */
5896 tmp = 0U;
5897 for (i = 0; i < 17; i++) {
5898 tmp += L4_MABX_B.RelationalOperator1_g1[i];
5899 }
5900
5901 L4_MABX_B.Add_g = (uint8_T)tmp;
5902
5903 /* End of Sum: '<S649>/Add' */
5904
5905 /* RelationalOperator: '<S653>/Compare' incorporates:
5906 * Constant: '<S653>/Constant'
5907 */
5908 L4_MABX_B.Compare_g = (L4_MABX_B.Add_g == L4_MABX_P.Constant_Value_cl);
5909
5910 /* Logic: '<S649>/Logical Operator' */
5911 L4_MABX_B.LogicalOperator_f = (L4_MABX_B.Unit_Delay3 && L4_MABX_B.Compare_g);
5912
5913 /* UnitDelay: '<S649>/Unit_Delay' */
5914 L4_MABX_B.Unit_Delay_l = L4_MABX_DW.Unit_Delay_DSTATE_k;
5915
5916 /* Logic: '<S655>/Logical Operator3' */
5917 L4_MABX_B.LogicalOperator3_c = !L4_MABX_B.Unit_Delay_l;
5918
5919 /* UnitDelay: '<S655>/Unit_Delay' */
5920 L4_MABX_B.Unit_Delay_lt = L4_MABX_DW.Unit_Delay_DSTATE_dl;
5921
5922 /* Logic: '<S655>/Logical Operator' */
5923 L4_MABX_B.LogicalOperator_id = (L4_MABX_B.LogicalOperator3_c &&
5924 L4_MABX_B.Unit_Delay_lt);
5925
5926 /* Logic: '<S655>/Logical Operator1' */
5927 L4_MABX_B.LogicalOperator1_c = (L4_MABX_B.LogicalOperator_f ||
5928 L4_MABX_B.LogicalOperator_id);
5929
5930 /* Outputs for Enabled SubSystem: '<S630>/SSI2_031' incorporates:
5931 * EnablePort: '<S631>/Enable'
5932 */
5933 /* Constant: '<S450>/Constant' */
5934 if (L4_MABX_P.Constant_Value_gt > 0.0) {
5935 /* S-Function (rti_commonblock): '<S631>/S-Function1' */
5936 /* This comment workarounds a code generation problem */
5937
5938 /* dSPACE RTICAN RX Message Block: "SSI2_03" Id:217065731 */
5939 {
5940 UInt32 *CAN_Msg;
5941 static dsfloat time_old = 0.0;
5942
5943 /* Read status and timestamp info (previous message) */
5944 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].timestamp !=
5945 time_old) {
5946 /* ... save timestamp info for the calculation of the RX status
5947 during the consecutive sample hit*/
5948 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].
5949 timestamp;
5950
5951 /* ... set the processed flag to one */
5952 L4_MABX_B.SFunction1_o8_lw = 1.0;
5953 L4_MABX_B.SFunction1_o9_m = (real_T)
5954 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].timestamp;
5955 L4_MABX_B.SFunction1_o10_l = (real_T)
5956 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].deltatime;
5957 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02903].data;
5958
5959 /* Decode CAN message */
5960 {
5961 {
5962 rtican_Signal_t CAN_Sgn;
5963
5964 /* ...... "PitchAngleExRange" (0|24, standard signal, unsigned int, little endian) */
5965 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
5966 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
5967 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2];
5968 CAN_Sgn.UnsignedSgn &= 0x00FFFFFF;
5969 L4_MABX_B.SFunction1_o1_f5 = -250 + ( 3.0517578125E-5 * ( ((real_T)
5970 CAN_Sgn.UnsignedSgn) ) );
5971
5972 /* ...... "RollAngleExRange" (24|24, standard signal, unsigned int, little endian) */
5973 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
5974 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
5975 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[5];
5976 CAN_Sgn.UnsignedSgn &= 0x00FFFFFF;
5977 L4_MABX_B.SFunction1_o2_gk = -250 + ( 3.0517578125E-5 * ( ((real_T)
5978 CAN_Sgn.UnsignedSgn) ) );
5979
5980 /* ...... "PitchAngleExRangeCompensation" (48|2, standard signal, unsigned int, little endian) */
5981 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
5982 CAN_Sgn.UnsignedSgn &= 0x00000003;
5983 L4_MABX_B.SFunction1_o3_aa = ((real_T) CAN_Sgn.UnsignedSgn);
5984
5985 /* ...... "PitchAngleExRangeFigureOfMerit" (50|2, standard signal, unsigned int, little endian) */
5986 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
5987 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
5988 CAN_Sgn.UnsignedSgn &= 0x00000003;
5989 L4_MABX_B.SFunction1_o4_p0 = ((real_T) CAN_Sgn.UnsignedSgn);
5990
5991 /* ...... "RollAngleExRangeCompensation" (52|2, standard signal, unsigned int, little endian) */
5992 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
5993 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
5994 CAN_Sgn.UnsignedSgn &= 0x00000003;
5995 L4_MABX_B.SFunction1_o5_k = ((real_T) CAN_Sgn.UnsignedSgn);
5996
5997 /* ...... "RollAngleExRangeFigureOfMerit" (54|2, standard signal, unsigned int, little endian) */
5998 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
5999 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
6000 CAN_Sgn.UnsignedSgn &= 0x00000003;
6001 L4_MABX_B.SFunction1_o6_i = ((real_T) CAN_Sgn.UnsignedSgn);
6002
6003 /* ...... "RllAndPtchExRngMsurementLatency" (56|8, standard signal, unsigned int, little endian) */
6004 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
6005 CAN_Sgn.UnsignedSgn &= 0x000000FF;
6006 L4_MABX_B.SFunction1_o7_o = 0.5 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
6007 }
6008 }
6009 } else {
6010 /* set RX status to 0 because no new message has arrived */
6011 L4_MABX_B.SFunction1_o8_lw = 0.0;
6012 }
6013 }
6014 }
6015
6016 /* End of Constant: '<S450>/Constant' */
6017 /* End of Outputs for SubSystem: '<S630>/SSI2_031' */
6018
6019 /* DataTypeConversion: '<S630>/Data Type Conversion1' */
6020 L4_MABX_B.PitchAngleExRange = L4_MABX_B.SFunction1_o1_f5;
6021
6022 /* Outputs for Enabled SubSystem: '<S621>/PX2_LanePosEst' incorporates:
6023 * EnablePort: '<S624>/Enable'
6024 */
6025 /* Constant: '<S447>/Constant' */
6026 if (L4_MABX_P.Constant_Value_pa) {
6027 /* S-Function (rti_commonblock): '<S624>/S-Function1' */
6028 /* This comment workarounds a code generation problem */
6029
6030 /* dSPACE RTICAN RX Message Block: "PX2_LanePosEst" Id:769 */
6031 {
6032 UInt32 *CAN_Msg;
6033 static dsfloat time_old = 0.0;
6034
6035 /* Read status and timestamp info (previous message) */
6036 if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].timestamp !=
6037 time_old) {
6038 /* ... save timestamp info for the calculation of the RX status
6039 during the consecutive sample hit*/
6040 time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].timestamp;
6041
6042 /* ... set the processed flag to one */
6043 L4_MABX_B.SFunction1_o5_h = 1.0;
6044 L4_MABX_B.SFunction1_o6_pv = (real_T)
6045 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].timestamp;
6046 L4_MABX_B.SFunction1_o7_k = (real_T)
6047 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].deltatime;
6048 CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x301].data;
6049
6050 /* Decode CAN message */
6051 {
6052 {
6053 rtican_Signal_t CAN_Sgn;
6054
6055 /* ...... "PX2_LanePosEstAngle" (0|16, standard signal, signed int, little endian) */
6056 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
6057 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
6058 CAN_Sgn.SignedSgn &= 0x0000FFFF;
6059 if (CAN_Sgn.SignedSgn >> 15) {
6060 CAN_Sgn.SignedSgn |= 0xFFFF0000;
6061 }
6062
6063 L4_MABX_B.SFunction1_o1_m = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
6064
6065 /* ...... "PX2_LanePosEstNumPoints" (16|8, standard signal, unsigned int, little endian) */
6066 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
6067 CAN_Sgn.UnsignedSgn &= 0x000000FF;
6068 L4_MABX_B.SFunction1_o2_kz = ((real_T) CAN_Sgn.UnsignedSgn);
6069
6070 /* ...... "PX2_LanePosEstPosition" (24|16, standard signal, signed int, little endian) */
6071 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
6072 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
6073 CAN_Sgn.SignedSgn &= 0x0000FFFF;
6074 if (CAN_Sgn.SignedSgn >> 15) {
6075 CAN_Sgn.SignedSgn |= 0xFFFF0000;
6076 }
6077
6078 L4_MABX_B.SFunction1_o3_on = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) );
6079
6080 /* ...... "PX2_LanePosEstNumLanes" (40|4, standard signal, unsigned int, little endian) */
6081 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
6082 CAN_Sgn.UnsignedSgn &= 0x0000000F;
6083 L4_MABX_B.SFunction1_o4_ke = ((real_T) CAN_Sgn.UnsignedSgn);
6084 }
6085 }
6086 } else {
6087 /* set RX status to 0 because no new message has arrived */
6088 L4_MABX_B.SFunction1_o5_h = 0.0;
6089 }
6090 }
6091 }
6092
6093 /* End of Outputs for SubSystem: '<S621>/PX2_LanePosEst' */
6094
6095 /* Outputs for Enabled SubSystem: '<S628>/Bendix_Prop2C2_Status_30' incorporates:
6096 * EnablePort: '<S629>/Enable'
6097 */
6098 /* Constant: '<S449>/Constant' */
6099 if (L4_MABX_P.Constant_Value_bk > 0.0) {
6100 /* S-Function (rti_commonblock): '<S629>/S-Function1' */
6101 /* This comment workarounds a code generation problem */
6102
6103 /* dSPACE RTICAN RX Message Block: "Prop2C2_Status_30" Id:419382064 */
6104 {
6105 UInt32 *CAN_Msg;
6106 static dsfloat time_old = 0.0;
6107
6108 /* Read status and timestamp info (previous message) */
6109 if (can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].timestamp !=
6110 time_old) {
6111 /* ... save timestamp info for the calculation of the RX status
6112 during the consecutive sample hit*/
6113 time_old = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].
6114 timestamp;
6115
6116 /* ... set the processed flag to one */
6117 L4_MABX_B.SFunction1_o11_j = 1.0;
6118 L4_MABX_B.SFunction1_o12_g = (real_T)
6119 can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].timestamp;
6120 L4_MABX_B.SFunction1_o13_g = (real_T)
6121 can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].deltatime;
6122 CAN_Msg = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF4330].data;
6123
6124 /* Decode CAN message */
6125 {
6126 {
6127 rtican_Signal_t CAN_Sgn;
6128
6129 /* ...... "PressureP4" (0|8, standard signal, unsigned int, little endian) */
6130 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
6131 CAN_Sgn.UnsignedSgn &= 0x000000FF;
6132 L4_MABX_B.SFunction1_o1_kq = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
6133
6134 /* ...... "PressureP1" (8|8, standard signal, unsigned int, little endian) */
6135 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
6136 CAN_Sgn.UnsignedSgn &= 0x000000FF;
6137 L4_MABX_B.SFunction1_o2_gr = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
6138
6139 /* ...... "PressureP21" (16|8, standard signal, unsigned int, little endian) */
6140 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
6141 CAN_Sgn.UnsignedSgn &= 0x000000FF;
6142 L4_MABX_B.SFunction1_o3_pd = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
6143
6144 /* ...... "PressureP22" (24|8, standard signal, unsigned int, little endian) */
6145 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
6146 CAN_Sgn.UnsignedSgn &= 0x000000FF;
6147 L4_MABX_B.SFunction1_o4_jgy = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
6148
6149 /* ...... "PressureP42" (32|8, standard signal, unsigned int, little endian) */
6150 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
6151 CAN_Sgn.UnsignedSgn &= 0x000000FF;
6152 L4_MABX_B.SFunction1_o5_c = 80 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
6153
6154 /* ...... "XPR1ControlStatus" (40|4, standard signal, unsigned int, little endian) */
6155 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
6156 CAN_Sgn.UnsignedSgn &= 0x0000000F;
6157 L4_MABX_B.SFunction1_o6_p = ((real_T) CAN_Sgn.UnsignedSgn);
6158
6159 /* ...... "XPR2ControlStatus" (44|4, standard signal, unsigned int, little endian) */
6160 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
6161 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
6162 CAN_Sgn.UnsignedSgn &= 0x0000000F;
6163 L4_MABX_B.SFunction1_o7_av = ((real_T) CAN_Sgn.UnsignedSgn);
6164
6165 /* ...... "XPR3ControlStatus" (48|4, standard signal, unsigned int, little endian) */
6166 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
6167 CAN_Sgn.UnsignedSgn &= 0x0000000F;
6168 L4_MABX_B.SFunction1_o8_cu = ((real_T) CAN_Sgn.UnsignedSgn);
6169
6170 /* ...... "XPRErrorState" (56|2, standard signal, unsigned int, little endian) */
6171 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
6172 CAN_Sgn.UnsignedSgn &= 0x00000003;
6173 L4_MABX_B.SFunction1_o9_i = ((real_T) CAN_Sgn.UnsignedSgn);
6174
6175 /* ...... "XPRControlMode" (58|4, standard signal, unsigned int, little endian) */
6176 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
6177 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
6178 CAN_Sgn.UnsignedSgn &= 0x0000000F;
6179 L4_MABX_B.SFunction1_o10_n = ((real_T) CAN_Sgn.UnsignedSgn);
6180 }
6181 }
6182 } else {
6183 /* set RX status to 0 because no new message has arrived */
6184 L4_MABX_B.SFunction1_o11_j = 0.0;
6185 }
6186 }
6187 }
6188
6189 /* End of Constant: '<S449>/Constant' */
6190 /* End of Outputs for SubSystem: '<S628>/Bendix_Prop2C2_Status_30' */
6191
6192 /* DataTypeConversion: '<S628>/Data Type Conversion15' */
6193 PositionFinalLimited = L4_MABX_B.SFunction1_o10_n;
6194 if (PositionFinalLimited < 256.0) {
6195 if (PositionFinalLimited >= 0.0) {
6196 starting_index = (uint8_T)PositionFinalLimited;
6197 } else {
6198 starting_index = 0U;
6199 }
6200 } else {
6201 starting_index = MAX_uint8_T;
6202 }
6203
6204 L4_MABX_B.DataTypeConversion15_c = starting_index;
6205
6206 /* End of DataTypeConversion: '<S628>/Data Type Conversion15' */
6207
6208 /* DataTypeConversion: '<S628>/Data Type Conversion5' */
6209 L4_MABX_B.XPRControlMode = (ENUM_XPR_CONTROL_MODE_T)
6210 safe_cast_to_ENUM_XPR_CONTROL_M(L4_MABX_B.DataTypeConversion15_c);
6211
6212 /* DataTypeConversion: '<S628>/Data Type Conversion4' */
6213 PositionFinalLimited = L4_MABX_B.SFunction1_o9_i;
6214 if (PositionFinalLimited < 256.0) {
6215 if (PositionFinalLimited >= 0.0) {
6216 starting_index = (uint8_T)PositionFinalLimited;
6217 } else {
6218 starting_index = 0U;
6219 }
6220 } else {
6221 starting_index = MAX_uint8_T;
6222 }
6223
6224 L4_MABX_B.DataTypeConversion4_gi = starting_index;
6225
6226 /* End of DataTypeConversion: '<S628>/Data Type Conversion4' */
6227
6228 /* DataTypeConversion: '<S628>/Data Type Conversion14' */
6229 L4_MABX_B.XPRErrorState = (ENUM_XPR_ERROR_STATE_T)
6230 safe_cast_to_ENUM_XPR_ERROR_STA(L4_MABX_B.DataTypeConversion4_gi);
6231
6232 /* DataTypeConversion: '<S628>/Data Type Conversion7' */
6233 L4_MABX_B.PressureP1 = L4_MABX_B.SFunction1_o2_gr;
6234
6235 /* DataTypeConversion: '<S628>/Data Type Conversion6' */
6236 L4_MABX_B.PressureP4 = L4_MABX_B.SFunction1_o1_kq;
6237
6238 /* DataTypeConversion: '<S628>/Data Type Conversion11' */
6239 L4_MABX_B.PressureP21 = L4_MABX_B.SFunction1_o3_pd;
6240
6241 /* DataTypeConversion: '<S628>/Data Type Conversion12' */
6242 L4_MABX_B.PressureP22 = L4_MABX_B.SFunction1_o4_jgy;
6243
6244 /* DataTypeConversion: '<S628>/Data Type Conversion13' */
6245 L4_MABX_B.PressureP42 = L4_MABX_B.SFunction1_o5_c;
6246
6247 /* RelationalOperator: '<S660>/Operator' incorporates:
6248 * Constant: '<S466>/Constant3'
6249 * Constant: '<S658>/Constant1'
6250 */
6251 L4_MABX_B.Operator_jhs = (PROPB_REAX_CHANNEL_APV ==
6252 L4_MABX_P.Constant1_Value_em);
6253
6254 /* Outputs for Enabled SubSystem: '<S578>/PropB_REAX_2_13' incorporates:
6255 * EnablePort: '<S580>/Enable'
6256 */
6257 if (L4_MABX_B.Operator_jhs) {
6258 /* S-Function (rti_commonblock): '<S580>/S-Function1' */
6259 /* This comment workarounds a code generation problem */
6260
6261 /* dSPACE RTICAN RX Message Block: "PropB_REAX_2_13" Id:419426323 */
6262 {
6263 UInt32 *CAN_Msg;
6264 static dsfloat time_old = 0.0;
6265
6266 /* Read status and timestamp info (previous message) */
6267 if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].timestamp !=
6268 time_old) {
6269 /* ... save timestamp info for the calculation of the RX status
6270 during the consecutive sample hit*/
6271 time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].
6272 timestamp;
6273
6274 /* ... set the processed flag to one */
6275 L4_MABX_B.SFunction1_o3_b = 1.0;
6276 L4_MABX_B.SFunction1_o4_hf = (real_T)
6277 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].timestamp;
6278 L4_MABX_B.SFunction1_o5_pr = (real_T)
6279 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].deltatime;
6280 CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF013].data;
6281
6282 /* Decode CAN message */
6283 {
6284 {
6285 rtican_Signal_t CAN_Sgn;
6286
6287 /* ...... "PropB_REAX_2_ActualHandwheelPos" (0|32, standard signal, signed int, little endian) */
6288 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
6289 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
6290 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2];
6291 CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3];
6292 L4_MABX_B.SFunction1_o1_cc = 0.0439453125 * ( ((real_T)
6293 CAN_Sgn.SignedSgn) );
6294
6295 /* ...... "PropB_REAX_2_EchoedStrWhlPos" (32|32, standard signal, signed int, little endian) */
6296 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
6297 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
6298 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6];
6299 CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7];
6300 L4_MABX_B.SFunction1_o2_kb = 0.0439453125 * ( ((real_T)
6301 CAN_Sgn.SignedSgn) );
6302 }
6303 }
6304 } else {
6305 /* set RX status to 0 because no new message has arrived */
6306 L4_MABX_B.SFunction1_o3_b = 0.0;
6307 }
6308 }
6309 }
6310
6311 /* End of Outputs for SubSystem: '<S578>/PropB_REAX_2_13' */
6312
6313 /* RelationalOperator: '<S659>/Operator' incorporates:
6314 * Constant: '<S466>/Constant3'
6315 * Constant: '<S658>/Constant'
6316 */
6317 L4_MABX_B.Operator_nl = (PROPB_REAX_CHANNEL_APV ==
6318 L4_MABX_P.Constant_Value_m1a);
6319
6320 /* RelationalOperator: '<S661>/Operator' incorporates:
6321 * Constant: '<S466>/Constant3'
6322 * Constant: '<S658>/Constant2'
6323 */
6324 L4_MABX_B.Operator_ap = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant2_Value_e);
6325
6326 /* RelationalOperator: '<S662>/Operator' incorporates:
6327 * Constant: '<S466>/Constant3'
6328 * Constant: '<S658>/Constant3'
6329 */
6330 L4_MABX_B.Operator_nw = (PROPB_REAX_CHANNEL_APV ==
6331 L4_MABX_P.Constant3_Value_d1);
6332
6333 /* RelationalOperator: '<S663>/Operator' incorporates:
6334 * Constant: '<S466>/Constant3'
6335 * Constant: '<S658>/Constant4'
6336 */
6337 L4_MABX_B.Operator_jbt = (PROPB_REAX_CHANNEL_APV ==
6338 L4_MABX_P.Constant4_Value_f);
6339
6340 /* RelationalOperator: '<S664>/Operator' incorporates:
6341 * Constant: '<S466>/Constant3'
6342 * Constant: '<S658>/Constant5'
6343 */
6344 L4_MABX_B.Operator_ej = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant5_Value_f);
6345
6346 /* Logic: '<S466>/OR' */
6347 L4_MABX_B.EnablePropB_ReAX_CAN6 = (L4_MABX_B.Operator_nl ||
6348 L4_MABX_B.Operator_ap || L4_MABX_B.Operator_nw || L4_MABX_B.Operator_jbt ||
6349 L4_MABX_B.Operator_ej);
6350
6351 /* Outputs for Enabled SubSystem: '<S579>/PropB_REAX_2_13' incorporates:
6352 * EnablePort: '<S581>/Enable'
6353 */
6354 if (L4_MABX_B.EnablePropB_ReAX_CAN6) {
6355 /* S-Function (rti_commonblock): '<S581>/S-Function1' */
6356 /* This comment workarounds a code generation problem */
6357
6358 /* dSPACE RTICAN RX Message Block: "PropB_REAX_2_13" Id:486535187 */
6359 {
6360 UInt32 *CAN_Msg;
6361 static dsfloat time_old = 0.0;
6362
6363 /* Read status and timestamp info (previous message) */
6364 if (can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].timestamp !=
6365 time_old) {
6366 /* ... save timestamp info for the calculation of the RX status
6367 during the consecutive sample hit*/
6368 time_old = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].
6369 timestamp;
6370
6371 /* ... set the processed flag to one */
6372 L4_MABX_B.SFunction1_o3_ep = 1.0;
6373 L4_MABX_B.SFunction1_o4_bl = (real_T)
6374 can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].timestamp;
6375 L4_MABX_B.SFunction1_o5_my = (real_T)
6376 can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].deltatime;
6377 CAN_Msg = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF013].data;
6378
6379 /* Decode CAN message */
6380 {
6381 {
6382 rtican_Signal_t CAN_Sgn;
6383
6384 /* ...... "PropB_REAX_2_ActualHandwheelPos" (0|32, standard signal, signed int, little endian) */
6385 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
6386 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
6387 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2];
6388 CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3];
6389 L4_MABX_B.SFunction1_o1_gm = 0.0439453125 * ( ((real_T)
6390 CAN_Sgn.SignedSgn) );
6391
6392 /* ...... "PropB_REAX_2_EchoedStrWhlPos" (32|32, standard signal, signed int, little endian) */
6393 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
6394 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
6395 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6];
6396 CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7];
6397 L4_MABX_B.SFunction1_o2_jh = 0.0439453125 * ( ((real_T)
6398 CAN_Sgn.SignedSgn) );
6399 }
6400 }
6401 } else {
6402 /* set RX status to 0 because no new message has arrived */
6403 L4_MABX_B.SFunction1_o3_ep = 0.0;
6404 }
6405 }
6406 }
6407
6408 /* End of Outputs for SubSystem: '<S579>/PropB_REAX_2_13' */
6409
6410 /* Switch: '<S443>/Switch' */
6411 if (L4_MABX_B.Operator_jhs) {
6412 ReAX_ActualHandwheelPos = L4_MABX_B.SFunction1_o1_cc;
6413 } else {
6414 ReAX_ActualHandwheelPos = L4_MABX_B.SFunction1_o1_gm;
6415 }
6416
6417 /* S-Function (dsa_tcpip_setup_sfcn): '<S399>/dsa_tcpip_setup' */
6418
6419 /* Level2 S-Function Block: '<S399>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */
6420 {
6421 SimStruct *rts = L4_MABX_M->childSfunctions[3];
6422 ssSetOutputPortSignal(rts, 0, &EthernetLinkStatus);
6423 sfcnOutputs(rts,0);
6424 }
6425
6426 /* Constant: '<S3>/Enable' */
6427 L4_MABX_B.Enable = L4_MABX_P.Enable_Value;
6428
6429 /* DiscretePulseGenerator: '<S398>/Heartbeat' */
6430 L4_MABX_B.Heartbeat = (L4_MABX_DW.clockTickCounter < L4_MABX_P.Heartbeat_Duty)
6431 && (L4_MABX_DW.clockTickCounter >= 0) ? L4_MABX_P.Heartbeat_Amp : 0.0;
6432 if (L4_MABX_DW.clockTickCounter >= L4_MABX_P.Heartbeat_Period - 1.0) {
6433 L4_MABX_DW.clockTickCounter = 0;
6434 } else {
6435 L4_MABX_DW.clockTickCounter++;
6436 }
6437
6438 /* End of DiscretePulseGenerator: '<S398>/Heartbeat' */
6439
6440 /* DataTypeConversion: '<S398>/Cast To Boolean' */
6441 MABX_Heartbeat = (L4_MABX_B.Heartbeat != 0.0);
6442
6443 /* UnitDelay: '<S3>/Unit_Delay' */
6444 L4_MABX_B.EStop_j = L4_MABX_DW.Unit_Delay_80_DSTATE;
6445 L4_MABX_B.EnableSW = L4_MABX_DW.Unit_Delay_81_DSTATE;
6446 L4_MABX_B.EngageReq = L4_MABX_DW.Unit_Delay_48_DSTATE;
6447 L4_MABX_B.LogPB = L4_MABX_DW.Unit_Delay_83_DSTATE;
6448 L4_MABX_B.AutonomousEnabled = L4_MABX_DW.Unit_Delay_45_DSTATE;
6449 L4_MABX_B.MABX_Mode_h = L4_MABX_DW.Unit_Delay_47_DSTATE;
6450 L4_MABX_B.BrakeSW_j = L4_MABX_DW.Unit_Delay_84_DSTATE;
6451
6452 /* BusCreator: '<S398>/Bus Creator' */
6453 L4_MABX_B.BusCreator.Heartbeat = MABX_Heartbeat;
6454 L4_MABX_B.BusCreator.EStop = L4_MABX_B.EStop_j;
6455 L4_MABX_B.BusCreator.EnableSW = L4_MABX_B.EnableSW;
6456 L4_MABX_B.BusCreator.EngageReq = L4_MABX_B.EngageReq;
6457 L4_MABX_B.BusCreator.LogEventPB = L4_MABX_B.LogPB;
6458 L4_MABX_B.BusCreator.AutonomousEnabled = L4_MABX_B.AutonomousEnabled;
6459 L4_MABX_B.BusCreator.MABX_Mode = L4_MABX_B.MABX_Mode_h;
6460 L4_MABX_B.BusCreator.BrakeSW = L4_MABX_B.BrakeSW_j;
6461
6462 /* S-Function (dsa_gen_tx_RTMapsEncode_sfun): '<S407>/Encoder' */
6463 Update_Tx_RTMapsEncode((RTMapsTX*)&L4_MABX_B.BusCreator,
6464 &L4_MABX_B.Encoder_o1[0], &L4_MABX_B.Encoder_o2);
6465
6466 /* S-Function (dsa_tcpip_udp_sfcn): '<S400>/TCPIP_Com' */
6467
6468 /* Level2 S-Function Block: '<S400>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */
6469 {
6470 SimStruct *rts = L4_MABX_M->childSfunctions[4];
6471 sfcnOutputs(rts,0);
6472 }
6473
6474 /* DataTypeConversion: '<S397>/Data Type Conversion' */
6475 L4_MABX_B.DataTypeConversion_a = L4_MABX_B.TCPIP_Com_o2;
6476
6477 /* S-Function (dsa_gen_rx_RTMapsDecode_sfun): '<S404>/Decoder' */
6478 Update_Rx_RTMapsDecode((uint8_T*)&L4_MABX_B.TCPIP_Com_o3[0],
6479 L4_MABX_B.DataTypeConversion_a, L4_MABX_B.TCPIP_Com_o1[2],
6480 &L4_MABX_B.Decoder_o1, &L4_MABX_B.Decoder_o2, &L4_MABX_B.Decoder_o3);
6481
6482 /* RelationalOperator: '<S406>/Compare' incorporates:
6483 * Constant: '<S406>/Constant'
6484 */
6485 L4_MABX_B.Compare_c5 = ((int32_T)L4_MABX_B.Decoder_o1.Heartbeat > (int32_T)
6486 L4_MABX_P.Constant_Value_ap);
6487
6488 /* UnitDelay: '<S405>/Delay Input1' */
6489 L4_MABX_B.Uk1_f5 = L4_MABX_DW.DelayInput1_DSTATE_np;
6490
6491 /* RelationalOperator: '<S405>/FixPt Relational Operator' */
6492 L4_MABX_B.FixPtRelationalOperator_i = ((int32_T)L4_MABX_B.Compare_c5 >
6493 (int32_T)L4_MABX_B.Uk1_f5);
6494
6495 /* UnitDelay: '<S403>/Unit Delay' */
6496 L4_MABX_B.UnitDelay_f = L4_MABX_DW.UnitDelay_DSTATE_k;
6497
6498 /* Switch: '<S403>/Switch' incorporates:
6499 * Constant: '<S403>/Constant1'
6500 */
6501 if (L4_MABX_B.FixPtRelationalOperator_i) {
6502 L4_MABX_B.Count = L4_MABX_P.Constant1_Value_e;
6503 } else {
6504 /* Sum: '<S403>/Sum' incorporates:
6505 * Constant: '<S403>/Constant'
6506 */
6507 L4_MABX_B.Sum_l = L4_MABX_P.Constant_Value_l + L4_MABX_B.UnitDelay_f;
6508 L4_MABX_B.Count = L4_MABX_B.Sum_l;
6509 }
6510
6511 /* End of Switch: '<S403>/Switch' */
6512
6513 /* Switch: '<S403>/Switch1' incorporates:
6514 * Constant: '<S403>/Constant2'
6515 * Constant: '<S403>/Constant3'
6516 */
6517 if (L4_MABX_B.Count > L4_MABX_P.Switch1_Threshold) {
6518 Heartbeat_Ok = L4_MABX_P.Constant2_Value_eu;
6519 } else {
6520 Heartbeat_Ok = L4_MABX_P.Constant3_Value_fa;
6521 }
6522
6523 /* End of Switch: '<S403>/Switch1' */
6524
6525 /* Logic: '<S397>/AND' */
6526 RTMapsOk = ((EthernetLinkStatus != 0.0) && Heartbeat_Ok);
6527
6528 /* Switch: '<S397>/Switch9' incorporates:
6529 * Constant: '<S397>/Failure'
6530 */
6531 if (RTMapsOk) {
6532 /* Gain: '<S397>/for_logging7' */
6533 L4_MABX_B.SupervisorMode_b = (int8_T)(((uint32_T)L4_MABX_P.for_logging7_Gain
6534 * L4_MABX_B.Decoder_o1.SupervisorMode) >> 7);
6535 SupervisorMode = (uint8_T)L4_MABX_B.SupervisorMode_b;
6536 } else {
6537 SupervisorMode = L4_MABX_P.Failure_Value_k;
6538 }
6539
6540 /* End of Switch: '<S397>/Switch9' */
6541
6542 /* RelationalOperator: '<S402>/Operator' incorporates:
6543 * Constant: '<S397>/Supervisor_Autonomous_Mode'
6544 */
6545 L4_MABX_B.Operator_m1 = (L4_MABX_P.Supervisor_Autonomous_Mode_Valu ==
6546 SupervisorMode);
6547
6548 /* Logic: '<S397>/AND1' */
6549 L4_MABX_B.SystemsOk = (RTMapsOk && L4_MABX_B.Operator_m1);
6550
6551 /* Switch: '<S397>/Switch' incorporates:
6552 * Constant: '<S397>/No Data'
6553 * Switch: '<S397>/Switch1'
6554 * Switch: '<S397>/Switch3'
6555 * Switch: '<S397>/Switch4'
6556 * Switch: '<S397>/Switch5'
6557 */
6558 if (RTMapsOk) {
6559 /* Gain: '<S397>/for_logging' */
6560 L4_MABX_B.for_logging = L4_MABX_P.for_logging_Gain *
6561 L4_MABX_B.Decoder_o1.CurrentAzimuth;
6562 CurrentAzimuth_rad = L4_MABX_B.for_logging;
6563
6564 /* Gain: '<S397>/for_logging1' */
6565 L4_MABX_B.for_logging1 = L4_MABX_P.for_logging1_Gain *
6566 L4_MABX_B.Decoder_o1.TargetAzimuth;
6567 TargetAzimuth_rad = L4_MABX_B.for_logging1;
6568
6569 /* Gain: '<S397>/m//s_to_km//h_2' */
6570 L4_MABX_B.ms_to_kmh_2 = L4_MABX_P.ms_to_kmh_2_Gain *
6571 L4_MABX_B.Decoder_o1.TargetVelocity;
6572 TargetVelocity_kph = L4_MABX_B.ms_to_kmh_2;
6573
6574 /* Gain: '<S397>/for_logging2' */
6575 L4_MABX_B.for_logging2 = L4_MABX_P.for_logging2_Gain *
6576 L4_MABX_B.Decoder_o1.Curvature;
6577 Curvature = L4_MABX_B.for_logging2;
6578
6579 /* Gain: '<S397>/for_logging3' */
6580 L4_MABX_B.for_logging3 = L4_MABX_P.for_logging3_Gain *
6581 L4_MABX_B.Decoder_o1.CrosstrackError;
6582 CrosstrackError = L4_MABX_B.for_logging3;
6583 } else {
6584 CurrentAzimuth_rad = L4_MABX_P.NoData_Value;
6585 TargetAzimuth_rad = L4_MABX_P.NoData_Value;
6586 TargetVelocity_kph = L4_MABX_P.NoData_Value;
6587 Curvature = L4_MABX_P.NoData_Value;
6588 CrosstrackError = L4_MABX_P.NoData_Value;
6589 }
6590
6591 /* End of Switch: '<S397>/Switch' */
6592
6593 /* Outputs for Atomic SubSystem: '<S65>/Task_10ms' */
6594 /* UnitDelay: '<S97>/Unit Delay1' */
6595 L4_MABX_B.UnitDelay1_f = L4_MABX_DW.UnitDelay1_DSTATE_m;
6596
6597 /* UnitDelay: '<S76>/Unit_Delay' */
6598 L4_MABX_B.Unit_Delay_nh = L4_MABX_DW.Unit_Delay_DSTATE_fv;
6599
6600 /* RelationalOperator: '<S100>/Compare' incorporates:
6601 * Constant: '<S100>/Constant'
6602 */
6603 L4_MABX_B.Compare_jp = ((int32_T)L4_MABX_B.Unit_Delay_nh <= (int32_T)
6604 L4_MABX_P.Constant_Value_io);
6605
6606 /* UnitDelay: '<S98>/Delay Input1' */
6607 L4_MABX_B.Uk1_d = L4_MABX_DW.DelayInput1_DSTATE_d;
6608
6609 /* RelationalOperator: '<S98>/FixPt Relational Operator' */
6610 L4_MABX_B.FixPtRelationalOperator_o = ((int32_T)L4_MABX_B.Compare_jp >
6611 (int32_T)L4_MABX_B.Uk1_d);
6612
6613 /* UnitDelay: '<S97>/Unit Delay' */
6614 L4_MABX_B.UnitDelay_i = L4_MABX_DW.UnitDelay_DSTATE_b1;
6615
6616 /* Logic: '<S97>/OR' */
6617 L4_MABX_B.OR_e = (L4_MABX_B.FixPtRelationalOperator_o || L4_MABX_B.UnitDelay_i);
6618
6619 /* Switch: '<S97>/Switch' incorporates:
6620 * Constant: '<S97>/Constant0'
6621 */
6622 if (L4_MABX_B.OR_e) {
6623 /* Sum: '<S97>/Sum' incorporates:
6624 * Constant: '<S97>/Constant1'
6625 */
6626 L4_MABX_B.Sum_g = L4_MABX_B.UnitDelay1_f + L4_MABX_P.Constant1_Value;
6627 L4_MABX_B.Switch_a = L4_MABX_B.Sum_g;
6628 } else {
6629 L4_MABX_B.Switch_a = L4_MABX_P.Constant0_Value;
6630 }
6631
6632 /* End of Switch: '<S97>/Switch' */
6633
6634 /* RelationalOperator: '<S99>/Compare' incorporates:
6635 * Constant: '<S99>/Constant'
6636 */
6637 L4_MABX_B.Compare_f = (L4_MABX_B.Switch_a > L4_MABX_P.Constant_Value_hq);
6638
6639 /* Gain: '<S97>/Gain' incorporates:
6640 * Constant: '<S95>/2000ms Delay'
6641 */
6642 L4_MABX_B.Gain_co = (uint32_T)L4_MABX_P.Gain_Gain_b *
6643 L4_MABX_P.u000msDelay_Value;
6644
6645 /* RelationalOperator: '<S97>/LessThanOrEqual' */
6646 L4_MABX_B.LessThanOrEqual_g = (L4_MABX_B.Switch_a <= (real_T)L4_MABX_B.Gain_co
6647 * 1.9073486328125E-6);
6648
6649 /* Logic: '<S97>/AND' */
6650 L4_MABX_B.AND_f = (L4_MABX_B.Compare_f && L4_MABX_B.LessThanOrEqual_g);
6651
6652 /* Logic: '<S95>/NOT1' */
6653 L4_MABX_B.NOT1_h = !L4_MABX_B.AND_f;
6654
6655 /* Logic: '<S76>/AND1' */
6656 L4_MABX_B.AND1_i = (EStop && EnableSw && BrakeSW && L4_MABX_B.NOT1_h);
6657
6658 /* Sum: '<S96>/Subtract' */
6659 L4_MABX_B.Subtract_a = TargetVelocity_kph - L4_MABX_B.SFunction1_o1_ie;
6660
6661 /* RelationalOperator: '<S101>/Compare' incorporates:
6662 * Constant: '<S101>/Constant'
6663 */
6664 L4_MABX_B.Compare_is = (L4_MABX_B.Subtract_a >=
6665 L4_MABX_P.CompareToConstant_const_a);
6666
6667 /* Logic: '<S96>/AND' */
6668 L4_MABX_B.AND_a = (L4_MABX_B.AND1_i && EngagePB && L4_MABX_B.Compare_is);
6669
6670 /* Logic: '<S76>/OR' */
6671 L4_MABX_B.OR_l = (L4_MABX_B.Unit_Delay_nh || L4_MABX_B.AND_a);
6672
6673 /* Logic: '<S76>/AND' */
6674 L4_MABX_B.AutonomousEnabled_d = (L4_MABX_B.SystemsOk && L4_MABX_B.AND1_i &&
6675 L4_MABX_B.OR_l);
6676
6677 /* Logic: '<S83>/Logical Operator' */
6678 L4_MABX_B.LogicalOperator_d = !L4_MABX_B.AutonomousEnabled_d;
6679
6680 /* Outputs for Atomic SubSystem: '<S83>/If_Then_Else' */
6681
6682 /* Constant: '<S83>/APTC_PEDAL_POSITION_OVR_APV' incorporates:
6683 * Constant: '<S83>/APTC_DESIRED_PEDAL_POSITION_APV'
6684 */
6685 L4_MABX_If_Then_Else(L4_MABX_P.APTC_PEDAL_POSITION_OVR_APV_Val,
6686 L4_MABX_P.APTC_DESIRED_PEDAL_POSITION_APV,
6687 Pedal_pwm_position, &L4_MABX_B.If_Then_Else_o);
6688
6689 /* End of Outputs for SubSystem: '<S83>/If_Then_Else' */
6690
6691 /* DataTypeConversion: '<S83>/Data Type Conversion1' */
6692 L4_MABX_B.DataTypeConversion1_h = L4_MABX_B.SFunction1_o5_en;
6693
6694 /* Lookup_n-D: '<S83>/2-D Lookup Table' */
6695 L4_MABX_B.uDLookupTable = look2_binlcapw(L4_MABX_B.If_Then_Else_o.Switch,
6696 L4_MABX_B.DataTypeConversion1_h, APTC_TRQ_PED_TRQ_POS_STEP_MPV,
6697 APTC_TRQ_PED_TRQ_ESPD_STEP_MPV, APTC_TRQ_PED_TRQ_DATA_MPV,
6698 L4_MABX_P.uDLookupTable_maxIndex, 8U);
6699
6700 /* DataTypeConversion: '<S77>/Data Type Conversion5' */
6701 L4_MABX_B.DataTypeConversion5_o = L4_MABX_B.SFunction1_o1_ie;
6702
6703 /* RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' */
6704 if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) {
6705 L4_MABX_B.distanceSpdTarget_e = L4_MABX_DW.TmpRTBAtSignalConversion1Inport;
6706 }
6707
6708 /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates:
6709 * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV'
6710 */
6711 switch (LONG_SPEED_SRC_SELECTOR_APV) {
6712 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH:
6713 /* SignalConversion: '<S81>/Signal Conversion1' */
6714 L4_MABX_B.Vehicle_speed_target_g = L4_MABX_B.distanceSpdTarget_e;
6715 L4_MABX_B.Vehicle_speed_target_o = L4_MABX_B.Vehicle_speed_target_g;
6716 break;
6717
6718 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE:
6719 /* SignalConversion: '<S81>/Signal Conversion4' incorporates:
6720 * Constant: '<S81>/VSPD_TARGET_KPH_APV'
6721 */
6722 L4_MABX_B.Vehicle_speed_target_o5 = VSPD_TARGET_KPH_APV;
6723 L4_MABX_B.Vehicle_speed_target_o = L4_MABX_B.Vehicle_speed_target_o5;
6724 break;
6725
6726 default:
6727 /* SignalConversion: '<S81>/Signal Conversion9' */
6728 L4_MABX_B.Vehicle_speed_target_k = TargetVelocity_kph;
6729 L4_MABX_B.Vehicle_speed_target_o = L4_MABX_B.Vehicle_speed_target_k;
6730 break;
6731 }
6732
6733 /* SignalConversion: '<S81>/Signal Conversion16' */
6734 L4_MABX_B.VSPD_TARGET_KPH_APV_g = L4_MABX_B.Vehicle_speed_target_o;
6735
6736 /* Saturate: '<S81>/Saturation9' incorporates:
6737 * Constant: '<S81>/VSPD_HYST_KPH_APV'
6738 */
6739 DeltaTime = L4_MABX_P.VSPD_HYST_KPH_APV_Value;
6740 Time56 = L4_MABX_P.Saturation9_LowerSat;
6741 PositionFinalLimited = L4_MABX_P.Saturation9_UpperSat;
6742 if (DeltaTime > PositionFinalLimited) {
6743 L4_MABX_B.VSPD_HYST_KPH_APV_f = PositionFinalLimited;
6744 } else if (DeltaTime < Time56) {
6745 L4_MABX_B.VSPD_HYST_KPH_APV_f = Time56;
6746 } else {
6747 L4_MABX_B.VSPD_HYST_KPH_APV_f = DeltaTime;
6748 }
6749
6750 /* End of Saturate: '<S81>/Saturation9' */
6751
6752 /* Sum: '<S109>/Add' */
6753 L4_MABX_B.Add_k = L4_MABX_B.VSPD_TARGET_KPH_APV_g +
6754 L4_MABX_B.VSPD_HYST_KPH_APV_f;
6755
6756 /* RelationalOperator: '<S109>/Relational Operator' */
6757 L4_MABX_B.f_vspd_geq_than_target_plus_hys = (L4_MABX_B.DataTypeConversion5_o >=
6758 L4_MABX_B.Add_k);
6759
6760 /* Saturate: '<S81>/Saturation1' incorporates:
6761 * Constant: '<S81>/VSPD_BRAKE_STOP_THRESH_KPH_APV'
6762 */
6763 DeltaTime = L4_MABX_P.VSPD_BRAKE_STOP_THRESH_KPH_APV_;
6764 Time56 = L4_MABX_P.Saturation1_LowerSat;
6765 PositionFinalLimited = L4_MABX_P.Saturation1_UpperSat;
6766 if (DeltaTime > PositionFinalLimited) {
6767 L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b = PositionFinalLimited;
6768 } else if (DeltaTime < Time56) {
6769 L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b = Time56;
6770 } else {
6771 L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b = DeltaTime;
6772 }
6773
6774 /* End of Saturate: '<S81>/Saturation1' */
6775
6776 /* RelationalOperator: '<S109>/Relational Operator1' */
6777 L4_MABX_B.f_target_is_stop_thresh = (L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b
6778 == L4_MABX_B.VSPD_TARGET_KPH_APV_g);
6779
6780 /* RelationalOperator: '<S205>/Compare' incorporates:
6781 * Constant: '<S205>/Constant'
6782 */
6783 L4_MABX_B.Compare_e = (L4_MABX_B.VSPD_TARGET_KPH_APV_g ==
6784 L4_MABX_P.Constant_Value_k);
6785
6786 /* RelationalOperator: '<S109>/Relational Operator2' */
6787 L4_MABX_B.RelationalOperator2_p = (L4_MABX_B.VSPD_HYST_KPH_APV_f >=
6788 L4_MABX_B.VSPD_TARGET_KPH_APV_g);
6789
6790 /* RelationalOperator: '<S109>/Relational Operator3' */
6791 L4_MABX_B.RelationalOperator3 = (L4_MABX_B.VSPD_HYST_KPH_APV_f >=
6792 L4_MABX_B.DataTypeConversion5_o);
6793
6794 /* Logic: '<S109>/Logical Operator' */
6795 L4_MABX_B.f_vspd_leq_than_hyst_and_target = (L4_MABX_B.RelationalOperator2_p &&
6796 L4_MABX_B.RelationalOperator3);
6797
6798 /* Logic: '<S109>/Logical Operator1' */
6799 L4_MABX_B.LogicalOperator1_m = (L4_MABX_B.f_vspd_geq_than_target_plus_hys ||
6800 L4_MABX_B.f_target_is_stop_thresh || L4_MABX_B.Compare_e ||
6801 L4_MABX_B.f_vspd_leq_than_hyst_and_target);
6802
6803 /* DataTypeConversion: '<S77>/Data Type Conversion4' */
6804 L4_MABX_B.DataTypeConversion4_d5 = L4_MABX_B.AutonomousEnabled_d;
6805
6806 /* Logic: '<S109>/Logical Operator2' */
6807 L4_MABX_B.F_Brake_control_active = (L4_MABX_B.LogicalOperator1_m &&
6808 L4_MABX_B.DataTypeConversion4_d5);
6809
6810 /* DataTypeConversion: '<S79>/Data Type Conversion4' */
6811 L4_MABX_B.DataTypeConversion4_i = L4_MABX_B.SFunction1_o1_ie;
6812
6813 /* DataTypeConversion: '<S77>/Data Type Conversion1' */
6814 PositionFinalLimited = L4_MABX_B.SFunction1_o8_ct;
6815 if (PositionFinalLimited < 256.0) {
6816 if (PositionFinalLimited >= 0.0) {
6817 starting_index = (uint8_T)PositionFinalLimited;
6818 } else {
6819 starting_index = 0U;
6820 }
6821 } else {
6822 starting_index = MAX_uint8_T;
6823 }
6824
6825 L4_MABX_B.DataTypeConversion1_ba = starting_index;
6826
6827 /* End of DataTypeConversion: '<S77>/Data Type Conversion1' */
6828
6829 /* DataTypeConversion: '<S77>/Data Type Conversion3' */
6830 L4_MABX_B.BrkPedArbBrakeSwitch_c = (ENUM_J1939_SWITCH_T)
6831 L4_MABX_B.DataTypeConversion1_ba;
6832
6833 /* DataTypeConversion: '<S209>/Data Type Conversion1' */
6834 L4_MABX_B.DataTypeConversion1_cy = L4_MABX_B.BrkPedArbBrakeSwitch_c;
6835
6836 /* RelationalOperator: '<S215>/Compare' incorporates:
6837 * Constant: '<S215>/Constant'
6838 */
6839 L4_MABX_B.Compare_e5 = (L4_MABX_B.DataTypeConversion1_cy ==
6840 L4_MABX_P.CompareToConstant2_const);
6841
6842 /* Logic: '<S209>/Logical Operator2' */
6843 L4_MABX_B.LogicalOperator2_n = !L4_MABX_B.Compare_e5;
6844
6845 /* DataTypeConversion: '<S209>/Data Type Conversion5' */
6846 PositionFinalLimited = floor(L4_MABX_B.SFunction1_o4_oc);
6847 if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) {
6848 PositionFinalLimited = 0.0;
6849 } else {
6850 PositionFinalLimited = fmod(PositionFinalLimited, 256.0);
6851 }
6852
6853 L4_MABX_B.DataTypeConversion5_pw = (uint8_T)(PositionFinalLimited < 0.0 ?
6854 (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T)
6855 (uint8_T)PositionFinalLimited);
6856
6857 /* End of DataTypeConversion: '<S209>/Data Type Conversion5' */
6858
6859 /* DataTypeConversion: '<S209>/Data Type Conversion3' */
6860 L4_MABX_B.DataTypeConversion3_l = (ENUM_J1939_SWITCH_T)
6861 L4_MABX_B.DataTypeConversion5_pw;
6862
6863 /* RelationalOperator: '<S213>/Compare' incorporates:
6864 * Constant: '<S213>/Constant'
6865 */
6866 L4_MABX_B.Compare_ih = (L4_MABX_B.DataTypeConversion3_l ==
6867 L4_MABX_P.CompareToConstant_const_e);
6868
6869 /* RelationalOperator: '<S214>/Compare' incorporates:
6870 * Constant: '<S214>/Constant'
6871 */
6872 L4_MABX_B.Compare_ex = (L4_MABX_B.DataTypeConversion3_l ==
6873 L4_MABX_P.CompareToConstant1_const_j);
6874
6875 /* Logic: '<S209>/BrakingActive2' */
6876 L4_MABX_B.BrakingActive2 = (L4_MABX_B.Compare_ih || L4_MABX_B.Compare_ex);
6877
6878 /* Logic: '<S209>/BrakingActive1' */
6879 L4_MABX_B.f_brake_sw_off = (L4_MABX_B.LogicalOperator2_n &&
6880 L4_MABX_B.BrakingActive2);
6881
6882 /* RelationalOperator: '<S216>/Compare' incorporates:
6883 * Constant: '<S216>/Constant'
6884 */
6885 L4_MABX_B.Compare_ay = (L4_MABX_B.SPN524_TransSelectedGear >
6886 L4_MABX_P.Constant_Value_il);
6887
6888 /* RelationalOperator: '<S217>/Compare' incorporates:
6889 * Constant: '<S217>/Constant'
6890 */
6891 L4_MABX_B.Compare_os = (L4_MABX_B.SPN523_TransCurrentGear >
6892 L4_MABX_P.Constant_Value_f);
6893
6894 /* Logic: '<S209>/Logical Operator1' */
6895 L4_MABX_B.f_brk_gov_inactive = !L4_MABX_B.F_Brake_control_active;
6896
6897 /* Logic: '<S209>/Logical Operator' */
6898 L4_MABX_B.LogicalOperator_ke = (L4_MABX_B.AutonomousEnabled_d &&
6899 L4_MABX_B.f_brake_sw_off && L4_MABX_B.Compare_ay && L4_MABX_B.Compare_os &&
6900 L4_MABX_B.f_brk_gov_inactive);
6901
6902 /* Outputs for Enabled SubSystem: '<S79>/Throttle_controller_gov' incorporates:
6903 * EnablePort: '<S212>/Enable'
6904 */
6905 if (L4_MABX_B.LogicalOperator_ke) {
6906 if (!L4_MABX_DW.Throttle_controller_gov_MODE) {
6907 /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay1' */
6908 L4_MABX_DW.Unit_Delay1_DSTATE_p1 =
6909 L4_MABX_P.Unit_Delay1_InitialCondition_o;
6910
6911 /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay' */
6912 L4_MABX_DW.Unit_Delay_DSTATE_lq = L4_MABX_P.Unit_Delay_InitialCondition_b2;
6913
6914 /* InitializeConditions for UnitDelay: '<S247>/Unit_Delay' */
6915 L4_MABX_DW.Unit_Delay_DSTATE_be = L4_MABX_P.Unit_Delay_InitialCondition_lj;
6916
6917 /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay1' */
6918 L4_MABX_DW.Unit_Delay1_DSTATE_h = L4_MABX_P.Unit_Delay1_InitialCondition_a;
6919
6920 /* InitializeConditions for UnitDelay: '<S268>/Unit_Delay' */
6921 L4_MABX_DW.Unit_Delay_DSTATE_fi = L4_MABX_P.Unit_Delay_InitialCondition_bm;
6922
6923 /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay2' */
6924 L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq =
6925 L4_MABX_P.FixPtUnitDelay2_InitialCondit_a;
6926
6927 /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay1' */
6928 L4_MABX_DW.FixPtUnitDelay1_DSTATE_a =
6929 L4_MABX_P.FixPtUnitDelay1_InitialCondit_o;
6930
6931 /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay2' */
6932 L4_MABX_DW.Unit_Delay2_DSTATE_m = L4_MABX_P.Unit_Delay2_InitialCondition_j;
6933
6934 /* InitializeConditions for UnitDelay: '<S222>/Unit_Delay' */
6935 L4_MABX_DW.Unit_Delay_DSTATE_fz = L4_MABX_P.Unit_Delay_InitialCondition_kg;
6936 L4_MABX_DW.Throttle_controller_gov_MODE = true;
6937 }
6938
6939 /* DataTypeConversion: '<S219>/Data Type Conversion9' */
6940 L4_MABX_B.DataTypeConversion9_h = L4_MABX_B.SFunction1_o4_jr;
6941
6942 /* DataTypeConversion: '<S219>/Data Type Conversion1' */
6943 L4_MABX_B.DataTypeConversion1_iq = L4_MABX_B.SFunction1_o2_a4;
6944
6945 /* Sum: '<S219>/Add' */
6946 L4_MABX_B.Add_di = L4_MABX_B.DataTypeConversion9_h +
6947 L4_MABX_B.DataTypeConversion1_iq;
6948
6949 /* RelationalOperator: '<S224>/Relational Operator1' incorporates:
6950 * Constant: '<S219>/Constant1'
6951 */
6952 L4_MABX_B.RelationalOperator1_ng = (L4_MABX_B.Add_di >=
6953 L4_MABX_P.Constant1_Value_c);
6954
6955 /* RelationalOperator: '<S224>/Relational Operator' incorporates:
6956 * Constant: '<S219>/Constant3'
6957 */
6958 L4_MABX_B.RelationalOperator_d3 = (L4_MABX_B.Add_di <=
6959 L4_MABX_P.Constant3_Value_d);
6960
6961 /* Outputs for Atomic SubSystem: '<S224>/If_Then_Else1' */
6962
6963 /* Constant: '<S219>/Constant3' */
6964 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_d3,
6965 L4_MABX_P.Constant3_Value_d, L4_MABX_B.Add_di,
6966 &L4_MABX_B.If_Then_Else1_h);
6967
6968 /* End of Outputs for SubSystem: '<S224>/If_Then_Else1' */
6969
6970 /* Outputs for Atomic SubSystem: '<S224>/If_Then_Else' */
6971
6972 /* Constant: '<S219>/Constant1' */
6973 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_ng,
6974 L4_MABX_P.Constant1_Value_c,
6975 L4_MABX_B.If_Then_Else1_h.Switch,
6976 &L4_MABX_B.If_Then_Else_ct);
6977
6978 /* End of Outputs for SubSystem: '<S224>/If_Then_Else' */
6979
6980 /* DataTypeConversion: '<S219>/Data Type Conversion2' */
6981 L4_MABX_B.DataTypeConversion2_id = L4_MABX_B.SPN514_NominalFrictionPercentTo;
6982
6983 /* RelationalOperator: '<S225>/Relational Operator1' incorporates:
6984 * Constant: '<S219>/Constant2'
6985 */
6986 L4_MABX_B.RelationalOperator1_ch = (L4_MABX_B.DataTypeConversion2_id >=
6987 L4_MABX_P.Constant2_Value_b);
6988
6989 /* RelationalOperator: '<S225>/Relational Operator' incorporates:
6990 * Constant: '<S219>/Constant4'
6991 */
6992 L4_MABX_B.RelationalOperator_j = (L4_MABX_B.DataTypeConversion2_id <=
6993 L4_MABX_P.Constant4_Value);
6994
6995 /* Outputs for Atomic SubSystem: '<S225>/If_Then_Else1' */
6996
6997 /* Constant: '<S219>/Constant4' */
6998 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_j,
6999 L4_MABX_P.Constant4_Value,
7000 L4_MABX_B.DataTypeConversion2_id,
7001 &L4_MABX_B.If_Then_Else1_kg);
7002
7003 /* End of Outputs for SubSystem: '<S225>/If_Then_Else1' */
7004
7005 /* Outputs for Atomic SubSystem: '<S225>/If_Then_Else' */
7006
7007 /* Constant: '<S219>/Constant2' */
7008 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_ch,
7009 L4_MABX_P.Constant2_Value_b,
7010 L4_MABX_B.If_Then_Else1_kg.Switch,
7011 &L4_MABX_B.If_Then_Else_bo);
7012
7013 /* End of Outputs for SubSystem: '<S225>/If_Then_Else' */
7014
7015 /* DataTypeConversion: '<S219>/Data Type Conversion3' */
7016 L4_MABX_B.DataTypeConversion3_he = L4_MABX_B.SPN2978_EstEngParasiticLossesPe;
7017
7018 /* RelationalOperator: '<S226>/Relational Operator1' incorporates:
7019 * Constant: '<S219>/Constant5'
7020 */
7021 L4_MABX_B.RelationalOperator1_l = (L4_MABX_B.DataTypeConversion3_he >=
7022 L4_MABX_P.Constant5_Value);
7023
7024 /* RelationalOperator: '<S226>/Relational Operator' incorporates:
7025 * Constant: '<S219>/Constant6'
7026 */
7027 L4_MABX_B.RelationalOperator_fd = (L4_MABX_B.DataTypeConversion3_he <=
7028 L4_MABX_P.Constant6_Value);
7029
7030 /* Outputs for Atomic SubSystem: '<S226>/If_Then_Else1' */
7031
7032 /* Constant: '<S219>/Constant6' */
7033 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_fd,
7034 L4_MABX_P.Constant6_Value,
7035 L4_MABX_B.DataTypeConversion3_he,
7036 &L4_MABX_B.If_Then_Else1_dz);
7037
7038 /* End of Outputs for SubSystem: '<S226>/If_Then_Else1' */
7039
7040 /* Outputs for Atomic SubSystem: '<S226>/If_Then_Else' */
7041
7042 /* Constant: '<S219>/Constant5' */
7043 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_l,
7044 L4_MABX_P.Constant5_Value,
7045 L4_MABX_B.If_Then_Else1_dz.Switch,
7046 &L4_MABX_B.If_Then_Else_br);
7047
7048 /* End of Outputs for SubSystem: '<S226>/If_Then_Else' */
7049
7050 /* DataTypeConversion: '<S223>/Data Type Conversion5' */
7051 L4_MABX_B.DataTypeConversion5_i = L4_MABX_B.SFunction1_o1_i4;
7052
7053 /* Lookup_n-D: '<S230>/1-D Lookup Table' */
7054 L4_MABX_B.Coeff_of_drag_Cd = look1_binlcapw(L4_MABX_B.DataTypeConversion5_i,
7055 L4_MABX_P.uDLookupTable_bp01Data, L4_MABX_P.uDLookupTable_tableData, 2U);
7056
7057 /* Gain: '<S230>/KPH_TO_M//S' */
7058 L4_MABX_B.KPH_TO_MS = L4_MABX_P.KPH_TO_MS_Gain *
7059 L4_MABX_B.DataTypeConversion5_i;
7060
7061 /* Math: '<S230>/Math Function'
7062 *
7063 * About '<S230>/Math Function':
7064 * Operator: magnitude^2
7065 */
7066 PositionFinalLimited = L4_MABX_B.KPH_TO_MS;
7067 L4_MABX_B.MathFunction = PositionFinalLimited * PositionFinalLimited;
7068
7069 /* DataTypeConversion: '<S223>/Data Type Conversion' */
7070 L4_MABX_B.DataTypeConversion_ik = L4_MABX_B.SFunction1_o1_nb;
7071
7072 /* Gain: '<S230>/KPA_TO_PA' */
7073 L4_MABX_B.KPA_TO_PA = L4_MABX_P.KPA_TO_PA_Gain *
7074 L4_MABX_B.DataTypeConversion_ik;
7075
7076 /* DataTypeConversion: '<S223>/Data Type Conversion4' */
7077 L4_MABX_B.DataTypeConversion4_b = L4_MABX_B.SFunction1_o3_ip;
7078
7079 /* Sum: '<S230>/Add' incorporates:
7080 * Constant: '<S230>/Constant'
7081 */
7082 L4_MABX_B.Add_o = L4_MABX_B.DataTypeConversion4_b + L4_MABX_P.Constant_Value;
7083
7084 /* Product: '<S230>/Product' incorporates:
7085 * Constant: '<S230>/Constant1'
7086 */
7087 L4_MABX_B.Product_nm = L4_MABX_B.Add_o * L4_MABX_P.Constant1_Value_p;
7088
7089 /* Product: '<S230>/Divide' */
7090 L4_MABX_B.Air_density_kgm3 = L4_MABX_B.KPA_TO_PA / L4_MABX_B.Product_nm;
7091
7092 /* Product: '<S230>/Product1' incorporates:
7093 * Constant: '<S223>/Veh_Frontal_Area_m^2'
7094 * Constant: '<S230>/Constant2'
7095 */
7096 L4_MABX_B.Aerodynamic_resistance_Ra = L4_MABX_B.Coeff_of_drag_Cd *
7097 L4_MABX_P.Veh_Frontal_Area_m2_Value * L4_MABX_B.MathFunction *
7098 L4_MABX_B.Air_density_kgm3 * L4_MABX_P.Constant2_Value_h;
7099
7100 /* DataTypeConversion: '<S223>/Data Type Conversion6' */
7101 L4_MABX_B.DataTypeConversion6_f = L4_MABX_B.PitchAngleExRange;
7102
7103 /* Product: '<S231>/Divide' incorporates:
7104 * Constant: '<S231>/Constant2'
7105 * Constant: '<S231>/Constant3'
7106 */
7107 L4_MABX_B.grade_angle_radians = L4_MABX_B.DataTypeConversion6_f *
7108 L4_MABX_P.Constant2_Value_bc / L4_MABX_P.Constant3_Value_n;
7109
7110 /* Trigonometry: '<S231>/Trigonometric Function' */
7111 L4_MABX_B.TrigonometricFunction_a = sin(L4_MABX_B.grade_angle_radians);
7112
7113 /* Product: '<S231>/Product1' incorporates:
7114 * Constant: '<S231>/Constant1'
7115 */
7116 L4_MABX_B.Gradient_resistance_Rg = L4_MABX_B.SPN1760_GrossCombinationVehicle
7117 * L4_MABX_B.TrigonometricFunction_a * L4_MABX_P.Constant1_Value_a;
7118
7119 /* Gain: '<S234>/KPA_TO_M//S' */
7120 L4_MABX_B.KPA_TO_MS = L4_MABX_P.KPA_TO_MS_Gain *
7121 L4_MABX_B.DataTypeConversion5_i;
7122
7123 /* Product: '<S234>/Divide2' incorporates:
7124 * Constant: '<S234>/Constant2'
7125 * Constant: '<S234>/Constant6'
7126 */
7127 L4_MABX_B.Divide2_c = L4_MABX_P.Constant2_Value_bq * L4_MABX_B.KPA_TO_MS /
7128 L4_MABX_P.Constant6_Value_g;
7129
7130 /* Math: '<S234>/Math Function'
7131 *
7132 * About '<S234>/Math Function':
7133 * Operator: magnitude^2
7134 */
7135 PositionFinalLimited = L4_MABX_B.Divide2_c;
7136 L4_MABX_B.MathFunction_l = PositionFinalLimited * PositionFinalLimited;
7137
7138 /* Sum: '<S234>/Add' incorporates:
7139 * Constant: '<S234>/Constant1'
7140 */
7141 L4_MABX_B.Add_nj = L4_MABX_P.Constant1_Value_m + L4_MABX_B.MathFunction_l;
7142
7143 /* Outputs for Atomic SubSystem: '<S228>/If_Then_Else' */
7144
7145 /* Constant: '<S223>/TIRE1_tire_pressure' incorporates:
7146 * Constant: '<S228>/Truck166_tire_pressure'
7147 */
7148 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_c,
7149 L4_MABX_P.TIRE1_tire_pressure_Value,
7150 L4_MABX_P.Truck166_tire_pressure_Value,
7151 &L4_MABX_B.If_Then_Else_nr);
7152
7153 /* End of Outputs for SubSystem: '<S228>/If_Then_Else' */
7154
7155 /* Gain: '<S234>/KPA_TO_BAR' */
7156 L4_MABX_B.KPA_TO_BAR = L4_MABX_P.KPA_TO_BAR_Gain *
7157 L4_MABX_B.If_Then_Else_nr.Switch;
7158
7159 /* Product: '<S234>/Divide' */
7160 L4_MABX_B.Divide_kj = L4_MABX_B.Add_nj / L4_MABX_B.KPA_TO_BAR;
7161
7162 /* Sum: '<S234>/Add1' incorporates:
7163 * Constant: '<S234>/Constant'
7164 */
7165 L4_MABX_B.Coeff_of_rolling_resistance_Cr = L4_MABX_P.Constant_Value_h +
7166 L4_MABX_B.Divide_kj;
7167
7168 /* Product: '<S232>/Divide1' incorporates:
7169 * Constant: '<S232>/Constant4'
7170 * Constant: '<S232>/Constant5'
7171 */
7172 L4_MABX_B.grade_angle_radians_a = L4_MABX_B.DataTypeConversion6_f *
7173 L4_MABX_P.Constant4_Value_o / L4_MABX_P.Constant5_Value_p;
7174
7175 /* Trigonometry: '<S232>/Trigonometric Function' */
7176 L4_MABX_B.TrigonometricFunction_e = cos(L4_MABX_B.grade_angle_radians_a);
7177
7178 /* Product: '<S232>/Product2' incorporates:
7179 * Constant: '<S232>/Constant3'
7180 */
7181 L4_MABX_B.Rolling_resistance_Rr = L4_MABX_B.Coeff_of_rolling_resistance_Cr *
7182 L4_MABX_B.SPN1760_GrossCombinationVehicle *
7183 L4_MABX_B.TrigonometricFunction_e * L4_MABX_P.Constant3_Value_p;
7184
7185 /* Sum: '<S228>/Add' incorporates:
7186 * Constant: '<S228>/Constant'
7187 */
7188 L4_MABX_B.TotalTractiveForce_N = ((L4_MABX_B.Aerodynamic_resistance_Ra +
7189 L4_MABX_B.Gradient_resistance_Rg) + L4_MABX_B.Rolling_resistance_Rr) +
7190 L4_MABX_P.Constant_Value_g;
7191
7192 /* Saturate: '<S223>/Saturation' */
7193 DeltaTime = L4_MABX_B.SPN526_TransActualGearRatio;
7194 Time56 = L4_MABX_P.Saturation_LowerSat_p;
7195 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_n;
7196 if (DeltaTime > PositionFinalLimited) {
7197 L4_MABX_B.Saturation_g = PositionFinalLimited;
7198 } else if (DeltaTime < Time56) {
7199 L4_MABX_B.Saturation_g = Time56;
7200 } else {
7201 L4_MABX_B.Saturation_g = DeltaTime;
7202 }
7203
7204 /* End of Saturate: '<S223>/Saturation' */
7205
7206 /* MATLAB Function: '<S223>/F_wheel_to_Tq_eng' incorporates:
7207 * Constant: '<S223>/N_rar'
7208 * Constant: '<S223>/R_wheel_m'
7209 * Constant: '<S223>/eta'
7210 */
7211 /* MATLAB Function 'STATE_CONTROL_10ms/Throttle_controller_gov/Determine_engine_torque_and_losses/CalculateRoadLoadTorque/F_wheel_to_Tq_eng': '<S229>:1' */
7212 /* '<S229>:1:3' */
7213 L4_MABX_B.road_load_tq = L4_MABX_B.TotalTractiveForce_N *
7214 L4_MABX_P.R_wheel_m_Value / L4_MABX_P.N_rar_Value / L4_MABX_B.Saturation_g
7215 / L4_MABX_P.eta_Value;
7216
7217 /* DataTypeConversion: '<S223>/Data Type Conversion1' */
7218 L4_MABX_B.DataTypeConversion1_b = L4_MABX_B.SPN544_EngineReferenceTorque;
7219
7220 /* Product: '<S223>/Divide' */
7221 L4_MABX_B.RoadLoadTorque_fract = L4_MABX_B.road_load_tq /
7222 L4_MABX_B.DataTypeConversion1_b;
7223
7224 /* Gain: '<S223>/Gain' */
7225 L4_MABX_B.RoadLoadTorque_pct = L4_MABX_P.Gain_Gain_n *
7226 L4_MABX_B.RoadLoadTorque_fract;
7227
7228 /* Outputs for Atomic SubSystem: '<S219>/If_Then_Else' */
7229
7230 /* Constant: '<S219>/UseFeedForwardRoadLoad' incorporates:
7231 * Constant: '<S219>/ZeroRoadLoadCPV'
7232 */
7233 L4_MABX_If_Then_Else(L4_MABX_P.UseFeedForwardRoadLoad_Value,
7234 L4_MABX_B.RoadLoadTorque_pct,
7235 L4_MABX_P.ZeroRoadLoadCPV_Value,
7236 &L4_MABX_B.If_Then_Else_a);
7237
7238 /* End of Outputs for SubSystem: '<S219>/If_Then_Else' */
7239
7240 /* Sum: '<S219>/Add1' */
7241 L4_MABX_B.FeedForwardTorque_pct = (L4_MABX_B.If_Then_Else_bo.Switch +
7242 L4_MABX_B.If_Then_Else_br.Switch) + L4_MABX_B.If_Then_Else_a.Switch;
7243
7244 /* UnitDelay: '<S220>/Unit_Delay1' */
7245 L4_MABX_B.Unit_Delay1_m5 = L4_MABX_DW.Unit_Delay1_DSTATE_p1;
7246
7247 /* Logic: '<S220>/Logical Operator' incorporates:
7248 * Constant: '<S220>/Constant1'
7249 */
7250 L4_MABX_B.f_gpid_reset = (L4_MABX_P.Constant1_Value_g1 ||
7251 L4_MABX_B.Unit_Delay1_m5);
7252
7253 /* Sum: '<S220>/Subtract' */
7254 L4_MABX_B.Subtract_f = L4_MABX_B.VSPD_TARGET_KPH_APV_g -
7255 L4_MABX_B.VSPD_HYST_KPH_APV_f;
7256
7257 /* RelationalOperator: '<S220>/Relational Operator' */
7258 L4_MABX_B.RelationalOperator_fl = (L4_MABX_B.DataTypeConversion4_i >
7259 L4_MABX_B.Subtract_f);
7260
7261 /* UnitDelay: '<S220>/Unit_Delay' */
7262 L4_MABX_B.Unit_Delay_d5 = L4_MABX_DW.Unit_Delay_DSTATE_lq;
7263
7264 /* RelationalOperator: '<S220>/Relational Operator1' */
7265 L4_MABX_B.RelationalOperator1_d = (L4_MABX_B.RelationalOperator_fl !=
7266 L4_MABX_B.Unit_Delay_d5);
7267
7268 /* Lookup_n-D: '<S241>/2D_Lookup_Table' */
7269 L4_MABX_B.uD_Lookup_Table_am = look2_binlcapw
7270 (L4_MABX_B.SPN1760_GrossCombinationVehicle,
7271 L4_MABX_B.SPN526_TransActualGearRatio, TQ_DEM_MASS_STEP_MPV,
7272 TQ_DEM_GEAR_RATIO_STEP_MPV, TQ_DEM_KP_DATA_MPV,
7273 L4_MABX_P.uD_Lookup_Table_maxIndex, 8U);
7274
7275 /* Lookup_n-D: '<S242>/2D_Lookup_Table' */
7276 L4_MABX_B.uD_Lookup_Table_o = look2_binlcapw
7277 (L4_MABX_B.SPN1760_GrossCombinationVehicle,
7278 L4_MABX_B.SPN526_TransActualGearRatio, TQ_DEM_MASS_STEP_MPV,
7279 TQ_DEM_GEAR_RATIO_STEP_MPV, TQ_DEM_KI_DATA_MPV,
7280 L4_MABX_P.uD_Lookup_Table_maxIndex_p, 8U);
7281
7282 /* Lookup_n-D: '<S243>/2D_Lookup_Table' */
7283 L4_MABX_B.uD_Lookup_Table_h = look2_binlcapw
7284 (L4_MABX_B.SPN1760_GrossCombinationVehicle,
7285 L4_MABX_B.SPN526_TransActualGearRatio, TQ_DEM_MASS_STEP_MPV,
7286 TQ_DEM_GEAR_RATIO_STEP_MPV, TQ_DEM_KD_DATA_MPV,
7287 L4_MABX_P.uD_Lookup_Table_maxIndex_a, 8U);
7288
7289 /* Abs: '<S244>/Abs' */
7290 L4_MABX_B.Abs_igm = fabs(L4_MABX_B.uD_Lookup_Table_o);
7291
7292 /* Abs: '<S244>/Abs1' */
7293 L4_MABX_B.Abs1_a = fabs(L4_MABX_B.uD_Lookup_Table_h);
7294
7295 /* UnitDelay: '<S247>/Unit_Delay' */
7296 L4_MABX_B.Unit_Delay_i0 = L4_MABX_DW.Unit_Delay_DSTATE_be;
7297
7298 /* Logic: '<S247>/Logical Operator1' */
7299 L4_MABX_B.LogicalOperator1_o = (L4_MABX_B.Unit_Delay_i0 ||
7300 L4_MABX_B.f_gpid_reset);
7301
7302 /* UnitDelay: '<S267>/Unit_Delay1' */
7303 L4_MABX_B.Unit_Delay1_dw = L4_MABX_DW.Unit_Delay1_DSTATE_h;
7304
7305 /* Logic: '<S267>/Logical Operator' */
7306 L4_MABX_B.LogicalOperator_at = (L4_MABX_B.LogicalOperator1_o ||
7307 L4_MABX_B.Unit_Delay1_dw);
7308
7309 /* UnitDelay: '<S268>/Unit_Delay' */
7310 L4_MABX_B.Unit_Delay_ne = L4_MABX_DW.Unit_Delay_DSTATE_fi;
7311
7312 /* Logic: '<S268>/Logical Operator1' */
7313 L4_MABX_B.LogicalOperator1_kz = (L4_MABX_B.LogicalOperator1_o ||
7314 L4_MABX_B.Unit_Delay_ne);
7315
7316 /* UnitDelay: '<S272>/FixPt Unit Delay2' */
7317 L4_MABX_B.FixPtUnitDelay2_a = L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq;
7318
7319 /* UnitDelay: '<S272>/FixPt Unit Delay1' */
7320 L4_MABX_B.Xold_a = L4_MABX_DW.FixPtUnitDelay1_DSTATE_a;
7321
7322 /* Switch: '<S272>/Init' */
7323 if (L4_MABX_B.FixPtUnitDelay2_a != 0) {
7324 L4_MABX_B.Init_pu = L4_MABX_B.VSPD_TARGET_KPH_APV_g;
7325 } else {
7326 L4_MABX_B.Init_pu = L4_MABX_B.Xold_a;
7327 }
7328
7329 /* End of Switch: '<S272>/Init' */
7330
7331 /* Abs: '<S268>/Abs' incorporates:
7332 * Constant: '<S212>/TqDemSlewInc'
7333 */
7334 L4_MABX_B.Abs_n = fabs(L4_MABX_P.TqDemSlewInc_Value);
7335
7336 /* Product: '<S268>/Product1' incorporates:
7337 * Constant: '<S212>/TqDemDt'
7338 */
7339 L4_MABX_B.Product1_g = L4_MABX_B.Abs_n * L4_MABX_P.TqDemDt_Value;
7340
7341 /* Sum: '<S268>/Add1' */
7342 L4_MABX_B.Add1_g = L4_MABX_B.Init_pu + L4_MABX_B.Product1_g;
7343
7344 /* MinMax: '<S268>/MinMax2' */
7345 DeltaTime = L4_MABX_B.VSPD_TARGET_KPH_APV_g;
7346 PositionFinalLimited = L4_MABX_B.Add1_g;
7347 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
7348 PositionFinalLimited = DeltaTime;
7349 }
7350
7351 L4_MABX_B.MinMax2_n = PositionFinalLimited;
7352
7353 /* End of MinMax: '<S268>/MinMax2' */
7354
7355 /* Abs: '<S268>/Abs1' incorporates:
7356 * Constant: '<S212>/TqDemSlewDec'
7357 */
7358 L4_MABX_B.Abs1_d = fabs(L4_MABX_P.TqDemSlewDec_Value);
7359
7360 /* Product: '<S268>/Product2' incorporates:
7361 * Constant: '<S212>/TqDemDt'
7362 */
7363 L4_MABX_B.Product2_bn = L4_MABX_P.TqDemDt_Value * L4_MABX_B.Abs1_d;
7364
7365 /* Sum: '<S268>/Subtract1' */
7366 L4_MABX_B.Subtract1_o = L4_MABX_B.Init_pu - L4_MABX_B.Product2_bn;
7367
7368 /* MinMax: '<S268>/MinMax1' */
7369 DeltaTime = L4_MABX_B.MinMax2_n;
7370 PositionFinalLimited = L4_MABX_B.Subtract1_o;
7371 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
7372 PositionFinalLimited = DeltaTime;
7373 }
7374
7375 L4_MABX_B.MinMax1_g = PositionFinalLimited;
7376
7377 /* End of MinMax: '<S268>/MinMax1' */
7378
7379 /* Outputs for Atomic SubSystem: '<S268>/If_Then_Else' */
7380 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_kz,
7381 L4_MABX_B.DataTypeConversion4_i, L4_MABX_B.MinMax1_g,
7382 &L4_MABX_B.If_Then_Else_cp);
7383
7384 /* End of Outputs for SubSystem: '<S268>/If_Then_Else' */
7385
7386 /* Sum: '<S245>/Subtract' */
7387 L4_MABX_B.Subtract_jb = L4_MABX_B.If_Then_Else_cp.Switch -
7388 L4_MABX_B.DataTypeConversion4_i;
7389
7390 /* MinMax: '<S267>/MinMax1' incorporates:
7391 * Constant: '<S212>/TqDemDt'
7392 * Constant: '<S212>/TqDemTFildCtrlErrorSecs'
7393 */
7394 DeltaTime = L4_MABX_P.TqDemDt_Value;
7395 PositionFinalLimited = L4_MABX_P.TqDemTFildCtrlErrorSecs_Value;
7396 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
7397 PositionFinalLimited = DeltaTime;
7398 }
7399
7400 L4_MABX_B.MinMax1_d = PositionFinalLimited;
7401
7402 /* End of MinMax: '<S267>/MinMax1' */
7403
7404 /* Saturate: '<S267>/Saturation' */
7405 DeltaTime = L4_MABX_B.MinMax1_d;
7406 Time56 = L4_MABX_P.Saturation_LowerSat_g5;
7407 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_f;
7408 if (DeltaTime > PositionFinalLimited) {
7409 L4_MABX_B.Saturation_dy = PositionFinalLimited;
7410 } else if (DeltaTime < Time56) {
7411 L4_MABX_B.Saturation_dy = Time56;
7412 } else {
7413 L4_MABX_B.Saturation_dy = DeltaTime;
7414 }
7415
7416 /* End of Saturate: '<S267>/Saturation' */
7417
7418 /* Product: '<S267>/Divide' incorporates:
7419 * Constant: '<S212>/TqDemDt'
7420 */
7421 L4_MABX_B.Divide_n = L4_MABX_P.TqDemDt_Value / L4_MABX_B.Saturation_dy;
7422
7423 /* Product: '<S267>/Product2' */
7424 L4_MABX_B.Product2_lv = L4_MABX_B.Subtract_jb * L4_MABX_B.Divide_n;
7425
7426 /* Sum: '<S267>/Subtract1' incorporates:
7427 * Constant: '<S267>/Constant1'
7428 */
7429 L4_MABX_B.Subtract1_k = L4_MABX_P.Constant1_Value_ci - L4_MABX_B.Divide_n;
7430
7431 /* UnitDelay: '<S267>/Unit_Delay2' */
7432 L4_MABX_B.Unit_Delay2_o = L4_MABX_DW.Unit_Delay2_DSTATE_m;
7433
7434 /* Product: '<S267>/Product1' */
7435 L4_MABX_B.Product1_p = L4_MABX_B.Subtract1_k * L4_MABX_B.Unit_Delay2_o;
7436
7437 /* Sum: '<S267>/Add1' */
7438 L4_MABX_B.Add1_i = L4_MABX_B.Product2_lv + L4_MABX_B.Product1_p;
7439
7440 /* Outputs for Atomic SubSystem: '<S267>/If_Then_Else' */
7441 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_at, L4_MABX_B.Subtract_jb,
7442 L4_MABX_B.Add1_i, &L4_MABX_B.If_Then_Else_k);
7443
7444 /* End of Outputs for SubSystem: '<S267>/If_Then_Else' */
7445
7446 /* RelationalOperator: '<S252>/Compare' incorporates:
7447 * Constant: '<S252>/Constant'
7448 */
7449 L4_MABX_B.Compare_go = (L4_MABX_B.Abs1_a >
7450 L4_MABX_P.CompareToConstant1_const_i);
7451
7452 /* Outputs for Enabled SubSystem: '<S244>/Calculate_D_term' */
7453
7454 /* Constant: '<S212>/TqDemDt' incorporates:
7455 * Constant: '<S212>/TqDemTFildTSecs'
7456 */
7457 L4_MABX_Calculate_D_term(L4_MABX_B.Compare_go, L4_MABX_B.uD_Lookup_Table_h,
7458 L4_MABX_P.TqDemDt_Value, L4_MABX_B.LogicalOperator1_o,
7459 L4_MABX_B.If_Then_Else_k.Switch, L4_MABX_P.TqDemTFildTSecs_Value,
7460 &L4_MABX_B.Calculate_D_term_h, &L4_MABX_DW.Calculate_D_term_h,
7461 &L4_MABX_P.Calculate_D_term_h);
7462
7463 /* End of Outputs for SubSystem: '<S244>/Calculate_D_term' */
7464
7465 /* Product: '<S250>/Product' */
7466 L4_MABX_B.Product_i = L4_MABX_B.uD_Lookup_Table_am *
7467 L4_MABX_B.If_Then_Else_k.Switch;
7468
7469 /* RelationalOperator: '<S212>/Relational Operator' */
7470 L4_MABX_B.RelationalOperator_a = (L4_MABX_B.SPN524_TransSelectedGear !=
7471 L4_MABX_B.SPN523_TransCurrentGear);
7472
7473 /* UnitDelay: '<S222>/Unit_Delay' */
7474 L4_MABX_B.Unit_Delay_m = L4_MABX_DW.Unit_Delay_DSTATE_fz;
7475
7476 /* RelationalOperator: '<S251>/Compare' incorporates:
7477 * Constant: '<S251>/Constant'
7478 */
7479 L4_MABX_B.Compare_pj = (L4_MABX_B.Abs_igm >
7480 L4_MABX_P.CompareToConstant_const_d);
7481
7482 /* Outputs for Enabled SubSystem: '<S244>/Calculate_I_term' */
7483
7484 /* Constant: '<S212>/TqDemDt' incorporates:
7485 * Constant: '<S212>/GpidAwCondIntegration'
7486 * Constant: '<S212>/TqDemAwHyst'
7487 */
7488 L4_MABX_Calculate_I_term(L4_MABX_B.Compare_pj, L4_MABX_B.Product_i,
7489 L4_MABX_B.uD_Lookup_Table_o, L4_MABX_B.If_Then_Else_ct.Switch,
7490 L4_MABX_B.If_Then_Else_k.Switch, L4_MABX_B.LogicalOperator1_o,
7491 L4_MABX_P.TqDemDt_Value, L4_MABX_B.FeedForwardTorque_pct,
7492 L4_MABX_P.GpidAwCondIntegration_Value, L4_MABX_P.TqDemAwHyst_Value,
7493 L4_MABX_B.RelationalOperator_a, L4_MABX_B.Unit_Delay_m,
7494 &L4_MABX_B.Calculate_I_term_n, &L4_MABX_DW.Calculate_I_term_n,
7495 &L4_MABX_P.Calculate_I_term_n);
7496
7497 /* End of Outputs for SubSystem: '<S244>/Calculate_I_term' */
7498
7499 /* RelationalOperator: '<S270>/min_relop' incorporates:
7500 * Constant: '<S212>/TqDemSlewInc'
7501 * Constant: '<S270>/min_val'
7502 */
7503 L4_MABX_B.min_relop_cb = (L4_MABX_P.CheckStaticLowerBound_min_b <=
7504 L4_MABX_P.TqDemSlewInc_Value);
7505
7506 /* Assertion: '<S270>/Assertion' */
7507 utAssert(L4_MABX_B.min_relop_cb);
7508
7509 /* Sum: '<S246>/Add' */
7510 L4_MABX_B.Add_ds = ((L4_MABX_B.Product_i +
7511 L4_MABX_B.Calculate_I_term_n.If_Then_Else.Switch) +
7512 L4_MABX_B.Calculate_D_term_h.Subtract) +
7513 L4_MABX_B.FeedForwardTorque_pct;
7514
7515 /* RelationalOperator: '<S273>/Relational Operator1' incorporates:
7516 * Constant: '<S212>/TqDemLimMax'
7517 */
7518 L4_MABX_B.RelationalOperator1_j = (L4_MABX_B.Add_ds >=
7519 L4_MABX_P.TqDemLimMax_Value);
7520
7521 /* RelationalOperator: '<S273>/Relational Operator' incorporates:
7522 * Constant: '<S212>/TqDemLimMin'
7523 */
7524 L4_MABX_B.RelationalOperator_p4 = (L4_MABX_B.Add_ds <=
7525 L4_MABX_P.TqDemLimMin_Value);
7526
7527 /* Outputs for Atomic SubSystem: '<S273>/If_Then_Else1' */
7528
7529 /* Constant: '<S212>/TqDemLimMin' */
7530 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_p4,
7531 L4_MABX_P.TqDemLimMin_Value, L4_MABX_B.Add_ds,
7532 &L4_MABX_B.If_Then_Else1_h3);
7533
7534 /* End of Outputs for SubSystem: '<S273>/If_Then_Else1' */
7535
7536 /* Outputs for Atomic SubSystem: '<S273>/If_Then_Else' */
7537
7538 /* Constant: '<S212>/TqDemLimMax' */
7539 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_j,
7540 L4_MABX_P.TqDemLimMax_Value,
7541 L4_MABX_B.If_Then_Else1_h3.Switch,
7542 &L4_MABX_B.If_Then_Else_pi);
7543
7544 /* End of Outputs for SubSystem: '<S273>/If_Then_Else' */
7545
7546 /* SignalConversion: '<S212>/OutportBufferForPID_d_term' */
7547 L4_MABX_B.PID_d_term_c = L4_MABX_B.Calculate_D_term_h.Subtract;
7548
7549 /* SignalConversion: '<S212>/OutportBufferForPID_hold_i_term_f' */
7550 L4_MABX_B.PID_hold_i_term_f_b =
7551 L4_MABX_B.Calculate_I_term_n.LogicalOperator2;
7552
7553 /* SignalConversion: '<S212>/OutportBufferForPID_i_term' */
7554 L4_MABX_B.PID_i_term_c = L4_MABX_B.Calculate_I_term_n.If_Then_Else.Switch;
7555 } else {
7556 if (L4_MABX_DW.Throttle_controller_gov_MODE) {
7557 /* Disable for Enabled SubSystem: '<S244>/Calculate_D_term' */
7558 if (L4_MABX_DW.Calculate_D_term_h.Calculate_D_term_MODE) {
7559 L4_Calculate_D_term_Disable(&L4_MABX_B.Calculate_D_term_h,
7560 &L4_MABX_DW.Calculate_D_term_h, &L4_MABX_P.Calculate_D_term_h);
7561 }
7562
7563 /* End of Disable for SubSystem: '<S244>/Calculate_D_term' */
7564
7565 /* Disable for Enabled SubSystem: '<S244>/Calculate_I_term' */
7566 if (L4_MABX_DW.Calculate_I_term_n.Calculate_I_term_MODE) {
7567 L4_Calculate_I_term_Disable(&L4_MABX_B.Calculate_I_term_n,
7568 &L4_MABX_DW.Calculate_I_term_n, &L4_MABX_P.Calculate_I_term_n);
7569 }
7570
7571 /* End of Disable for SubSystem: '<S244>/Calculate_I_term' */
7572
7573 /* Disable for Outport: '<S212>/PID_output' */
7574 L4_MABX_B.If_Then_Else_pi.Switch = L4_MABX_P.PID_output_Y0_c;
7575
7576 /* Disable for Outport: '<S212>/PID_output_unlim' */
7577 L4_MABX_B.Add_ds = L4_MABX_P.PID_output_unlim_Y0;
7578
7579 /* Disable for Outport: '<S212>/PID_control_error' */
7580 L4_MABX_B.If_Then_Else_k.Switch = L4_MABX_P.PID_control_error_Y0;
7581
7582 /* Disable for Outport: '<S212>/PID_p_term' */
7583 L4_MABX_B.Product_i = L4_MABX_P.PID_p_term_Y0;
7584
7585 /* Disable for Outport: '<S212>/PID_i_term' */
7586 L4_MABX_B.PID_i_term_c = L4_MABX_P.PID_i_term_Y0;
7587
7588 /* Disable for Outport: '<S212>/PID_d_term' */
7589 L4_MABX_B.PID_d_term_c = L4_MABX_P.PID_d_term_Y0;
7590
7591 /* Disable for Outport: '<S212>/PID_hold_i_term_f' */
7592 L4_MABX_B.PID_hold_i_term_f_b = L4_MABX_P.PID_hold_i_term_f_Y0;
7593 L4_MABX_DW.Throttle_controller_gov_MODE = false;
7594 }
7595 }
7596
7597 /* End of Outputs for SubSystem: '<S79>/Throttle_controller_gov' */
7598
7599 /* Switch: '<S79>/Switch' incorporates:
7600 * Constant: '<S79>/Constant3'
7601 */
7602 if (L4_MABX_B.F_Brake_control_active) {
7603 L4_MABX_B.ThrottlePID_Y_m = L4_MABX_P.Constant3_Value;
7604 } else {
7605 /* DataTypeConversion: '<S79>/Data Type Conversion3' */
7606 L4_MABX_B.DataTypeConversion3_m = L4_MABX_B.SPN544_EngineReferenceTorque;
7607
7608 /* Product: '<S79>/Product' incorporates:
7609 * Constant: '<S79>/Constant2'
7610 */
7611 L4_MABX_B.ThrottlePID_Y_c = L4_MABX_B.If_Then_Else_pi.Switch *
7612 L4_MABX_B.DataTypeConversion3_m * L4_MABX_P.Constant2_Value;
7613 L4_MABX_B.ThrottlePID_Y_m = L4_MABX_B.ThrottlePID_Y_c;
7614 }
7615
7616 /* End of Switch: '<S79>/Switch' */
7617
7618 /* MultiPortSwitch: '<S83>/Multiport Switch' incorporates:
7619 * Constant: '<S83>/APTC_DISABLED_PEDAL_POSITION_APV'
7620 * Constant: '<S83>/APTC_PEDAL_POS_SIG_SOURCE_APV'
7621 */
7622 switch (L4_MABX_P.APTC_PEDAL_POS_SIG_SOURCE_APV_V) {
7623 case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_DISABLED:
7624 L4_MABX_B.MultiportSwitch = L4_MABX_P.APTC_DISABLED_PEDAL_POSITION_AP;
7625 break;
7626
7627 case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_CAN_EEC2_00:
7628 L4_MABX_B.MultiportSwitch = L4_MABX_B.uDLookupTable;
7629 break;
7630
7631 case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_SW_EMULATION:
7632 L4_MABX_B.MultiportSwitch = L4_MABX_B.ThrottlePID_Y_m;
7633 break;
7634
7635 case ENUM_PEDAL_POS_SIGNAL_SOURCE_T_CAN_EEC2_00_AND_SW_EMULATION:
7636 /* MinMax: '<S83>/MinMax' */
7637 DeltaTime = L4_MABX_B.uDLookupTable;
7638 PositionFinalLimited = L4_MABX_B.ThrottlePID_Y_m;
7639 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
7640 PositionFinalLimited = DeltaTime;
7641 }
7642
7643 L4_MABX_B.MinMax_p = PositionFinalLimited;
7644
7645 /* End of MinMax: '<S83>/MinMax' */
7646 L4_MABX_B.MultiportSwitch = L4_MABX_B.MinMax_p;
7647 break;
7648
7649 default:
7650 L4_MABX_B.MultiportSwitch = L4_MABX_P.APTC_DISABLED_PEDAL_POSITION_AP;
7651 break;
7652 }
7653
7654 /* End of MultiPortSwitch: '<S83>/Multiport Switch' */
7655
7656 /* Outputs for Atomic SubSystem: '<S83>/If_Then_Else1' */
7657 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_d, L4_MABX_B.uDLookupTable,
7658 L4_MABX_B.MultiportSwitch, &L4_MABX_B.If_Then_Else1_lw);
7659
7660 /* End of Outputs for SubSystem: '<S83>/If_Then_Else1' */
7661
7662 /* DataTypeConversion: '<S82>/Data Type Conversion1' */
7663 L4_MABX_B.DataTypeConversion1_n3 = L4_MABX_B.SFunction1_o5_en;
7664
7665 /* Lookup_n-D: '<S85>/2D_Lookup_Table' */
7666 L4_MABX_B.uD_Lookup_Table = look2_binlcapw(L4_MABX_B.If_Then_Else1_lw.Switch,
7667 L4_MABX_B.DataTypeConversion1_n3, APTC_TRQ_PED_INV_MAP_TRQ_STEPS,
7668 APTC_TRQ_PED_TRQ_ESPD_STEP_MPV, APTC_TRQ_PED_INV_MAP_PED_POS_MPV,
7669 L4_MABX_P.uD_Lookup_Table_maxIndex_h, 83U);
7670
7671 /* Logic: '<S82>/Logical Operator' */
7672 L4_MABX_B.LogicalOperator_j2 = !L4_MABX_B.AutonomousEnabled_d;
7673
7674 /* Outputs for Atomic SubSystem: '<S82>/If_Then_Else' */
7675 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_j2, Pedal_pwm_position,
7676 L4_MABX_B.uD_Lookup_Table, &L4_MABX_B.If_Then_Else_f);
7677
7678 /* End of Outputs for SubSystem: '<S82>/If_Then_Else' */
7679
7680 /* RelationalOperator: '<S75>/Relational Operator' incorporates:
7681 * Constant: '<S75>/Constant'
7682 */
7683 L4_MABX_B.APTC_arb_pedal_low_idl_sw_o = (APTC_PEDAL_LOW_IDLE_SW_THR_APV >
7684 L4_MABX_B.If_Then_Else_f.Switch);
7685
7686 /* DataTypeConversion: '<S84>/Data Type Conversion1' */
7687 L4_MABX_B.DataTypeConversion1_a = L4_MABX_B.SPN544_EngineReferenceTorque;
7688
7689 /* RelationalOperator: '<S89>/Relational Operator1' incorporates:
7690 * Constant: '<S84>/EngRefTqLimHigh'
7691 */
7692 L4_MABX_B.RelationalOperator1_i = (L4_MABX_B.DataTypeConversion1_a >=
7693 L4_MABX_P.EngRefTqLimHigh_Value);
7694
7695 /* RelationalOperator: '<S89>/Relational Operator' incorporates:
7696 * Constant: '<S84>/EngRefTqLimLow'
7697 */
7698 L4_MABX_B.RelationalOperator_ca = (L4_MABX_B.DataTypeConversion1_a <=
7699 L4_MABX_P.EngRefTqLimLow_Value);
7700
7701 /* Outputs for Atomic SubSystem: '<S89>/If_Then_Else1' */
7702
7703 /* Constant: '<S84>/EngRefTqLimLow' */
7704 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_ca,
7705 L4_MABX_P.EngRefTqLimLow_Value,
7706 L4_MABX_B.DataTypeConversion1_a,
7707 &L4_MABX_B.If_Then_Else1_lo);
7708
7709 /* End of Outputs for SubSystem: '<S89>/If_Then_Else1' */
7710
7711 /* Outputs for Atomic SubSystem: '<S89>/If_Then_Else' */
7712
7713 /* Constant: '<S84>/EngRefTqLimHigh' */
7714 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_i,
7715 L4_MABX_P.EngRefTqLimHigh_Value,
7716 L4_MABX_B.If_Then_Else1_lo.Switch,
7717 &L4_MABX_B.If_Then_Else_ff);
7718
7719 /* End of Outputs for SubSystem: '<S89>/If_Then_Else' */
7720
7721 /* Sum: '<S84>/Subtract' incorporates:
7722 * Constant: '<S84>/FrictionTrqAtRefTrqSpeed'
7723 */
7724 L4_MABX_B.Subtract_j = L4_MABX_B.If_Then_Else_ff.Switch -
7725 L4_MABX_P.FrictionTrqAtRefTrqSpeed_Value;
7726
7727 /* Product: '<S84>/Divide' incorporates:
7728 * Constant: '<S84>/Constant1'
7729 */
7730 L4_MABX_B.Divide_hl = L4_MABX_B.If_Then_Else1_lw.Switch *
7731 L4_MABX_P.Constant1_Value_fg / L4_MABX_B.Subtract_j;
7732
7733 /* RelationalOperator: '<S90>/Relational Operator1' incorporates:
7734 * Constant: '<S84>/APPTqPercentMax'
7735 */
7736 L4_MABX_B.RelationalOperator1_ar = (L4_MABX_B.Divide_hl >=
7737 L4_MABX_P.APPTqPercentMax_Value);
7738
7739 /* RelationalOperator: '<S90>/Relational Operator' incorporates:
7740 * Constant: '<S84>/APPTqPercentMin'
7741 */
7742 L4_MABX_B.RelationalOperator_n = (L4_MABX_B.Divide_hl <=
7743 L4_MABX_P.APPTqPercentMin_Value);
7744
7745 /* Outputs for Atomic SubSystem: '<S90>/If_Then_Else1' */
7746
7747 /* Constant: '<S84>/APPTqPercentMin' */
7748 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_n,
7749 L4_MABX_P.APPTqPercentMin_Value, L4_MABX_B.Divide_hl,
7750 &L4_MABX_B.If_Then_Else1_p);
7751
7752 /* End of Outputs for SubSystem: '<S90>/If_Then_Else1' */
7753
7754 /* Outputs for Atomic SubSystem: '<S90>/If_Then_Else' */
7755
7756 /* Constant: '<S84>/APPTqPercentMax' */
7757 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_ar,
7758 L4_MABX_P.APPTqPercentMax_Value,
7759 L4_MABX_B.If_Then_Else1_p.Switch,
7760 &L4_MABX_B.If_Then_Else_iz);
7761
7762 /* End of Outputs for SubSystem: '<S90>/If_Then_Else' */
7763
7764 /* MultiPortSwitch: '<S76>/Autonomous Mode Switch' incorporates:
7765 * Constant: '<S76>/AUTONOMOUS_MODE_SELECTOR_APV'
7766 * Constant: '<S76>/GhostMode'
7767 */
7768 if (AUTONOMOUS_MODE_SELECTOR_APV == ENUM_AUTONOMOUS_MODE_T_AUTO) {
7769 AutonomousOutputEnabled = L4_MABX_B.AutonomousEnabled_d;
7770 } else {
7771 AutonomousOutputEnabled = (L4_MABX_P.GhostMode_Value != 0);
7772 }
7773
7774 /* End of MultiPortSwitch: '<S76>/Autonomous Mode Switch' */
7775
7776 /* Switch: '<S76>/Switch' incorporates:
7777 * Constant: '<S76>/Failure'
7778 * Constant: '<S76>/Running'
7779 */
7780 if (EStop) {
7781 tmp_1 = L4_MABX_P.Running_Value;
7782 if (tmp_1 < 0) {
7783 tmp_1 = 0;
7784 }
7785
7786 MABX_Mode = (uint8_T)tmp_1;
7787 } else {
7788 tmp_1 = L4_MABX_P.Failure_Value;
7789 if (tmp_1 < 0) {
7790 tmp_1 = 0;
7791 }
7792
7793 MABX_Mode = (uint8_T)tmp_1;
7794 }
7795
7796 /* End of Switch: '<S76>/Switch' */
7797
7798 /* DataTypeConversion: '<S104>/Data Type Conversion2' */
7799 PositionFinalLimited = floor(L4_MABX_B.SFunction1_o8_ct);
7800 if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) {
7801 PositionFinalLimited = 0.0;
7802 } else {
7803 PositionFinalLimited = fmod(PositionFinalLimited, 256.0);
7804 }
7805
7806 L4_MABX_B.DataTypeConversion2_ew1 = (uint8_T)(PositionFinalLimited < 0.0 ?
7807 (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T)
7808 (uint8_T)PositionFinalLimited);
7809
7810 /* End of DataTypeConversion: '<S104>/Data Type Conversion2' */
7811
7812 /* DataTypeConversion: '<S104>/Data Type Conversion' */
7813 L4_MABX_B.DataTypeConversion_lr = (ENUM_SWITCH_T)
7814 L4_MABX_B.DataTypeConversion2_ew1;
7815
7816 /* DataTypeConversion: '<S104>/Data Type Conversion3' */
7817 PositionFinalLimited = floor(L4_MABX_B.SFunction1_o4_oc);
7818 if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) {
7819 PositionFinalLimited = 0.0;
7820 } else {
7821 PositionFinalLimited = fmod(PositionFinalLimited, 256.0);
7822 }
7823
7824 L4_MABX_B.DataTypeConversion3_ps = (uint8_T)(PositionFinalLimited < 0.0 ?
7825 (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T)
7826 (uint8_T)PositionFinalLimited);
7827
7828 /* End of DataTypeConversion: '<S104>/Data Type Conversion3' */
7829
7830 /* DataTypeConversion: '<S104>/Data Type Conversion1' */
7831 L4_MABX_B.DataTypeConversion1_lu = (ENUM_SWITCH_T)
7832 L4_MABX_B.DataTypeConversion3_ps;
7833
7834 /* RelationalOperator: '<S104>/Relational Operator3' incorporates:
7835 * Constant: '<S104>/CPV3'
7836 */
7837 L4_MABX_B.RelationalOperator3_c[0] = (L4_MABX_B.DataTypeConversion_lr ==
7838 L4_MABX_P.CPV3_Value_p);
7839 L4_MABX_B.RelationalOperator3_c[1] = (L4_MABX_B.DataTypeConversion1_lu ==
7840 L4_MABX_P.CPV3_Value_p);
7841
7842 /* Logic: '<S104>/Logical Operator4' */
7843 L4_MABX_B.LogicalOperator4_o = (L4_MABX_B.RelationalOperator3_c[0] &&
7844 L4_MABX_B.RelationalOperator3_c[1]);
7845
7846 /* Gain: '<S104>/Gain4' */
7847 L4_MABX_B.Primary_brake_circuit_pressure_ = L4_MABX_P.Gain4_Gain *
7848 L4_MABX_B.PressureP42;
7849
7850 /* Gain: '<S104>/Gain5' */
7851 L4_MABX_B.Secondary_brake_circuit_pressur = L4_MABX_P.Gain5_Gain *
7852 L4_MABX_B.PressureP4;
7853
7854 /* RelationalOperator: '<S104>/Relational Operator4' incorporates:
7855 * Constant: '<S104>/BRAKE_APPL_THRESHOLD_KPA_APV'
7856 */
7857 L4_MABX_B.RelationalOperator4[0] = (L4_MABX_B.Primary_brake_circuit_pressure_ >
7858 L4_MABX_P.BRAKE_APPL_THRESHOLD_KPA_APV_Va);
7859 L4_MABX_B.RelationalOperator4[1] = (L4_MABX_B.Secondary_brake_circuit_pressur >
7860 L4_MABX_P.BRAKE_APPL_THRESHOLD_KPA_APV_Va);
7861
7862 /* Logic: '<S104>/Logical Operator3' */
7863 L4_MABX_B.F_Service_brake_pressure_applie = (L4_MABX_B.RelationalOperator4[0] ||
7864 L4_MABX_B.RelationalOperator4[1]);
7865
7866 /* RelationalOperator: '<S104>/Relational Operator6' incorporates:
7867 * Constant: '<S104>/CPV4'
7868 */
7869 L4_MABX_B.RelationalOperator6[0] = (L4_MABX_B.DataTypeConversion_lr ==
7870 L4_MABX_P.CPV4_Value_n);
7871 L4_MABX_B.RelationalOperator6[1] = (L4_MABX_B.DataTypeConversion1_lu ==
7872 L4_MABX_P.CPV4_Value_n);
7873
7874 /* Logic: '<S104>/Logical Operator' */
7875 L4_MABX_B.F_Brake_sw_CAN = (L4_MABX_B.RelationalOperator6[0] ||
7876 L4_MABX_B.RelationalOperator6[1]);
7877
7878 /* Logic: '<S104>/Logical Operator5' */
7879 L4_MABX_B.LogicalOperator5_n = (L4_MABX_B.F_Service_brake_pressure_applie ||
7880 L4_MABX_B.F_Brake_sw_CAN);
7881
7882 /* Outputs for Atomic SubSystem: '<S104>/If_Then_Else' */
7883 L4_MABX_If_Then_Else_l(L4_MABX_B.LogicalOperator4_o,
7884 L4_MABX_B.F_Service_brake_pressure_applie, L4_MABX_B.LogicalOperator5_n,
7885 &L4_MABX_B.If_Then_Else_la);
7886
7887 /* End of Outputs for SubSystem: '<S104>/If_Then_Else' */
7888
7889 /* RelationalOperator: '<S108>/Relational Operator1' incorporates:
7890 * Constant: '<S108>/SPN904_ZERO_SPD_CPV'
7891 */
7892 L4_MABX_B.F_Vehicle_stopped = (L4_MABX_B.DataTypeConversion5_o <=
7893 L4_MABX_P.SPN904_ZERO_SPD_CPV_Value);
7894
7895 /* Sum: '<S105>/Add' */
7896 L4_MABX_B.Add_d = L4_MABX_B.Primary_brake_circuit_pressure_ +
7897 L4_MABX_B.Secondary_brake_circuit_pressur;
7898
7899 /* Gain: '<S105>/Gain' */
7900 L4_MABX_B.Gain_go0 = L4_MABX_P.Gain_Gain_g * L4_MABX_B.Add_d;
7901
7902 /* Outputs for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' incorporates:
7903 * EnablePort: '<S184>/Enable'
7904 */
7905 if (L4_MABX_DW.Determine_shift_interlock_brake) {
7906 /* Disable for Outport: '<S184>/Shift_interlock_brake_press_target_kpa' */
7907 L4_MABX_B.If_Then_Else_il.Switch = L4_MABX_P.Shift_interlock_brake_press_tar;
7908
7909 /* Disable for Outport: '<S184>/F_Shift_interlock_conditions_met' */
7910 L4_MABX_B.F_Shift_interlock_conditions_me =
7911 L4_MABX_P.F_Shift_interlock_conditions_me;
7912 L4_MABX_DW.Determine_shift_interlock_brake = false;
7913 }
7914
7915 /* End of Outputs for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */
7916
7917 /* RelationalOperator: '<S206>/Compare' incorporates:
7918 * Constant: '<S206>/Constant'
7919 */
7920 L4_MABX_B.Compare_g4 = (L4_MABX_B.VSPD_TARGET_KPH_APV_g ==
7921 L4_MABX_P.Constant_Value_ol);
7922
7923 /* RelationalOperator: '<S109>/Relational Operator4' */
7924 L4_MABX_B.RelationalOperator4_l = (L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b >=
7925 L4_MABX_B.DataTypeConversion5_o);
7926
7927 /* Logic: '<S109>/Logical Operator3' */
7928 L4_MABX_B.F_Hold_brakes_at_zero_d = (L4_MABX_B.F_Brake_control_active &&
7929 L4_MABX_B.Compare_g4 && L4_MABX_B.RelationalOperator4_l);
7930
7931 /* Outputs for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' incorporates:
7932 * EnablePort: '<S183>/Enable'
7933 */
7934 if (L4_MABX_B.F_Hold_brakes_at_zero_d) {
7935 if (!L4_MABX_DW.Determine_brake_hold_pressure_t) {
7936 /* InitializeConditions for UnitDelay: '<S183>/Unit_Delay' */
7937 L4_MABX_DW.Unit_Delay_DSTATE_c = L4_MABX_P.Unit_Delay_InitialCondition_d;
7938
7939 /* InitializeConditions for UnitDelay: '<S187>/Unit_Delay' */
7940 L4_MABX_DW.Unit_Delay_DSTATE_or = L4_MABX_P.Unit_Delay_InitialCondition_fy;
7941
7942 /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay2' */
7943 L4_MABX_DW.FixPtUnitDelay2_DSTATE_je =
7944 L4_MABX_P.FixPtUnitDelay2_InitialCondit_e;
7945
7946 /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay1' */
7947 L4_MABX_DW.FixPtUnitDelay1_DSTATE_b0 =
7948 L4_MABX_P.FixPtUnitDelay1_InitialCondit_p;
7949
7950 /* InitializeConditions for UnitDelay: '<S188>/Unit_Delay' */
7951 L4_MABX_DW.Unit_Delay_DSTATE_oj = L4_MABX_P.Unit_Delay_InitialCondition_k;
7952 L4_MABX_DW.Determine_brake_hold_pressure_t = true;
7953 }
7954
7955 /* Logic: '<S183>/Logical Operator2' */
7956 L4_MABX_B.F_Brake_hold_conditions_met = (L4_MABX_B.If_Then_Else_la.Switch &&
7957 L4_MABX_B.F_Vehicle_stopped);
7958
7959 /* UnitDelay: '<S183>/Unit_Delay' */
7960 L4_MABX_B.Unit_Delay_a = L4_MABX_DW.Unit_Delay_DSTATE_c;
7961
7962 /* UnitDelay: '<S187>/Unit_Delay' */
7963 L4_MABX_B.Unit_Delay_h0 = L4_MABX_DW.Unit_Delay_DSTATE_or;
7964
7965 /* Logic: '<S187>/Logical Operator1' incorporates:
7966 * Constant: '<S183>/CPV1'
7967 */
7968 L4_MABX_B.LogicalOperator1_ou = (L4_MABX_P.CPV1_Value_p ||
7969 L4_MABX_B.Unit_Delay_h0);
7970
7971 /* Outputs for Atomic SubSystem: '<S183>/If_Then_Else1' */
7972
7973 /* Constant: '<S183>/CPV' */
7974 L4_MABX_If_Then_Else_g(L4_MABX_B.F_Brake_hold_conditions_met,
7975 L4_MABX_B.Unit_Delay_a, L4_MABX_P.CPV_Value_k, &L4_MABX_B.If_Then_Else1_mf);
7976
7977 /* End of Outputs for SubSystem: '<S183>/If_Then_Else1' */
7978
7979 /* UnitDelay: '<S191>/FixPt Unit Delay2' */
7980 L4_MABX_B.FixPtUnitDelay2_d = L4_MABX_DW.FixPtUnitDelay2_DSTATE_je;
7981
7982 /* UnitDelay: '<S191>/FixPt Unit Delay1' */
7983 L4_MABX_B.Xold_b = L4_MABX_DW.FixPtUnitDelay1_DSTATE_b0;
7984
7985 /* Switch: '<S191>/Init' */
7986 if (L4_MABX_B.FixPtUnitDelay2_d != 0) {
7987 L4_MABX_B.Init_k = L4_MABX_B.If_Then_Else1_mf.Switch;
7988 } else {
7989 L4_MABX_B.Init_k = L4_MABX_B.Xold_b;
7990 }
7991
7992 /* End of Switch: '<S191>/Init' */
7993
7994 /* Abs: '<S187>/Abs' incorporates:
7995 * Constant: '<S183>/BRAKE_PRESS_TARGET_S LEW_INC_APV'
7996 */
7997 L4_MABX_B.Abs_b = fabs(L4_MABX_P.BRAKE_PRESS_TARGET_SLEW_INC_APV);
7998
7999 /* DigitalClock: '<S188>/Digital Clock' */
8000 L4_MABX_B.DigitalClock_c = L4_MABX_M->Timing.t[0];
8001
8002 /* UnitDelay: '<S188>/Unit_Delay' */
8003 L4_MABX_B.Unit_Delay_ka = L4_MABX_DW.Unit_Delay_DSTATE_oj;
8004
8005 /* Sum: '<S188>/Subtract' */
8006 L4_MABX_B.Subtract_ko = L4_MABX_B.DigitalClock_c - L4_MABX_B.Unit_Delay_ka;
8007
8008 /* Product: '<S187>/Product1' */
8009 L4_MABX_B.Product1_f = L4_MABX_B.Abs_b * L4_MABX_B.Subtract_ko;
8010
8011 /* Sum: '<S187>/Add1' */
8012 L4_MABX_B.Add1_c = L4_MABX_B.Init_k + L4_MABX_B.Product1_f;
8013
8014 /* MinMax: '<S187>/MinMax2' */
8015 DeltaTime = L4_MABX_B.If_Then_Else1_mf.Switch;
8016 PositionFinalLimited = L4_MABX_B.Add1_c;
8017 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8018 PositionFinalLimited = DeltaTime;
8019 }
8020
8021 L4_MABX_B.MinMax2_c2 = PositionFinalLimited;
8022
8023 /* End of MinMax: '<S187>/MinMax2' */
8024
8025 /* Abs: '<S187>/Abs1' incorporates:
8026 * Constant: '<S183>/BRAKE_PRESS_TARGET_SLEW_DEC_APV'
8027 */
8028 L4_MABX_B.Abs1_ar = fabs(L4_MABX_P.BRAKE_PRESS_TARGET_SLEW_DEC_APV);
8029
8030 /* Product: '<S187>/Product2' */
8031 L4_MABX_B.Product2_c3 = L4_MABX_B.Subtract_ko * L4_MABX_B.Abs1_ar;
8032
8033 /* Sum: '<S187>/Subtract1' */
8034 L4_MABX_B.Subtract1_ev = L4_MABX_B.Init_k - L4_MABX_B.Product2_c3;
8035
8036 /* MinMax: '<S187>/MinMax1' */
8037 DeltaTime = L4_MABX_B.MinMax2_c2;
8038 PositionFinalLimited = L4_MABX_B.Subtract1_ev;
8039 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8040 PositionFinalLimited = DeltaTime;
8041 }
8042
8043 L4_MABX_B.MinMax1_jw = PositionFinalLimited;
8044
8045 /* End of MinMax: '<S187>/MinMax1' */
8046
8047 /* Outputs for Atomic SubSystem: '<S187>/If_Then_Else' */
8048 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_ou, L4_MABX_B.Gain_go0,
8049 L4_MABX_B.MinMax1_jw, &L4_MABX_B.If_Then_Else_nz);
8050
8051 /* End of Outputs for SubSystem: '<S187>/If_Then_Else' */
8052
8053 /* Outputs for Atomic SubSystem: '<S183>/If_Then_Else' */
8054 L4_MABX_If_Then_Else_g(L4_MABX_B.F_Brake_hold_conditions_met,
8055 L4_MABX_B.Unit_Delay_a, L4_MABX_B.If_Then_Else_nz.Switch,
8056 &L4_MABX_B.If_Then_Else_gj);
8057
8058 /* End of Outputs for SubSystem: '<S183>/If_Then_Else' */
8059
8060 /* RelationalOperator: '<S189>/min_relop' incorporates:
8061 * Constant: '<S183>/BRAKE_PRESS_TARGET_S LEW_INC_APV'
8062 * Constant: '<S189>/min_val'
8063 */
8064 L4_MABX_B.min_relop_i = (L4_MABX_P.CheckStaticLowerBound_min_i <=
8065 L4_MABX_P.BRAKE_PRESS_TARGET_SLEW_INC_APV);
8066
8067 /* Assertion: '<S189>/Assertion' */
8068 utAssert(L4_MABX_B.min_relop_i);
8069 } else {
8070 if (L4_MABX_DW.Determine_brake_hold_pressure_t) {
8071 /* Disable for Outport: '<S183>/Brake_hold_brake_press_target_kpa' */
8072 L4_MABX_B.If_Then_Else_gj.Switch =
8073 L4_MABX_P.Brake_hold_brake_press_target_k;
8074
8075 /* Disable for Outport: '<S183>/F_Brake_hold_conditions_met' */
8076 L4_MABX_B.F_Brake_hold_conditions_met =
8077 L4_MABX_P.F_Brake_hold_conditions_met_Y0;
8078 L4_MABX_DW.Determine_brake_hold_pressure_t = false;
8079 }
8080 }
8081
8082 /* End of Outputs for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */
8083
8084 /* MinMax: '<S105>/MinMax' */
8085 DeltaTime = L4_MABX_B.If_Then_Else_il.Switch;
8086 PositionFinalLimited = L4_MABX_B.If_Then_Else_gj.Switch;
8087 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8088 PositionFinalLimited = DeltaTime;
8089 }
8090
8091 L4_MABX_B.Brake_pressure_target_kpa = PositionFinalLimited;
8092
8093 /* End of MinMax: '<S105>/MinMax' */
8094
8095 /* Gain: '<S104>/Gain1' */
8096 L4_MABX_B.Bendix_2C2_Primary_brake_circui = L4_MABX_P.Gain1_Gain *
8097 L4_MABX_B.PressureP21;
8098
8099 /* Gain: '<S104>/Gain2' */
8100 L4_MABX_B.Bendix_2C2_Secondary_brake_circ = L4_MABX_P.Gain2_Gain *
8101 L4_MABX_B.PressureP22;
8102
8103 /* Sum: '<S106>/Add' */
8104 L4_MABX_B.Add_n = L4_MABX_B.Primary_brake_circuit_pressure_ +
8105 L4_MABX_B.Secondary_brake_circuit_pressur;
8106
8107 /* Gain: '<S106>/Gain' */
8108 L4_MABX_B.brake_system_avg_appl_pressure_ = L4_MABX_P.Gain_Gain_i *
8109 L4_MABX_B.Add_n;
8110
8111 /* Gain: '<S104>/Gain3' */
8112 L4_MABX_B.Primary_brake_circuit_pressur_n = L4_MABX_P.Gain3_Gain *
8113 L4_MABX_B.PressureP1;
8114
8115 /* Product: '<S106>/Divide2' */
8116 L4_MABX_B.Divide2 = L4_MABX_B.brake_system_avg_appl_pressure_ /
8117 L4_MABX_B.Primary_brake_circuit_pressur_n;
8118
8119 /* Gain: '<S106>/Gain5' */
8120 L4_MABX_B.Gain5 = L4_MABX_P.Gain5_Gain_l * L4_MABX_B.Divide2;
8121
8122 /* Saturate: '<S106>/Saturation3' */
8123 DeltaTime = L4_MABX_B.Gain5;
8124 Time56 = L4_MABX_P.Saturation3_LowerSat;
8125 PositionFinalLimited = L4_MABX_P.Saturation3_UpperSat;
8126 if (DeltaTime > PositionFinalLimited) {
8127 L4_MABX_B.Brake_appl_percent = PositionFinalLimited;
8128 } else if (DeltaTime < Time56) {
8129 L4_MABX_B.Brake_appl_percent = Time56;
8130 } else {
8131 L4_MABX_B.Brake_appl_percent = DeltaTime;
8132 }
8133
8134 /* End of Saturate: '<S106>/Saturation3' */
8135
8136 /* Outputs for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' incorporates:
8137 * EnablePort: '<S102>/Enable'
8138 */
8139 if (L4_MABX_B.F_Hold_brakes_at_zero_d) {
8140 if (!L4_MABX_DW.Bendix_2C2_brake_application_pr) {
8141 /* InitializeConditions for UnitDelay: '<S111>/Unit_Delay' */
8142 L4_MABX_DW.Unit_Delay_DSTATE_d = L4_MABX_P.Unit_Delay_InitialCondition;
8143
8144 /* InitializeConditions for UnitDelay: '<S115>/Unit_Delay' */
8145 L4_MABX_DW.Unit_Delay_DSTATE_omj =
8146 L4_MABX_P.Unit_Delay_InitialCondition_lt;
8147
8148 /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay1' */
8149 L4_MABX_DW.Unit_Delay1_DSTATE_b = L4_MABX_P.Unit_Delay1_InitialCondition;
8150
8151 /* InitializeConditions for UnitDelay: '<S136>/Unit_Delay' */
8152 L4_MABX_DW.Unit_Delay_DSTATE_h4 = L4_MABX_P.Unit_Delay_InitialCondition_og;
8153
8154 /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay2' */
8155 L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm =
8156 L4_MABX_P.FixPtUnitDelay2_InitialConditio;
8157
8158 /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay1' */
8159 L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1 =
8160 L4_MABX_P.FixPtUnitDelay1_InitialConditio;
8161
8162 /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay2' */
8163 L4_MABX_DW.Unit_Delay2_DSTATE_dy = L4_MABX_P.Unit_Delay2_InitialCondition;
8164
8165 /* InitializeConditions for UnitDelay: '<S110>/Unit_Delay' */
8166 L4_MABX_DW.Unit_Delay_DSTATE_i = L4_MABX_P.Unit_Delay_InitialCondition_p;
8167 L4_MABX_DW.Bendix_2C2_brake_application_pr = true;
8168 }
8169
8170 /* Sum: '<S102>/Add' */
8171 L4_MABX_B.Add_my = L4_MABX_B.Bendix_2C2_Primary_brake_circui +
8172 L4_MABX_B.Bendix_2C2_Secondary_brake_circ;
8173
8174 /* Gain: '<S102>/Gain' */
8175 L4_MABX_B.Gain_i = L4_MABX_P.Gain_Gain * L4_MABX_B.Add_my;
8176
8177 /* Abs: '<S112>/Abs' incorporates:
8178 * Constant: '<S102>/BRK_PRESS_DEM_KI_APV'
8179 */
8180 L4_MABX_B.Abs_k4 = fabs(L4_MABX_P.BRK_PRESS_DEM_KI_APV_Value);
8181
8182 /* Abs: '<S112>/Abs1' incorporates:
8183 * Constant: '<S102>/BRK_PRESS_DEM_KD_APV'
8184 */
8185 L4_MABX_B.Abs1_ap = fabs(L4_MABX_P.BRK_PRESS_DEM_KD_APV_Value);
8186
8187 /* DigitalClock: '<S111>/Digital Clock' */
8188 L4_MABX_B.DigitalClock_j = L4_MABX_M->Timing.t[0];
8189
8190 /* UnitDelay: '<S111>/Unit_Delay' */
8191 L4_MABX_B.Unit_Delay_j = L4_MABX_DW.Unit_Delay_DSTATE_d;
8192
8193 /* Sum: '<S111>/Subtract' */
8194 L4_MABX_B.Subtract_jr = L4_MABX_B.DigitalClock_j - L4_MABX_B.Unit_Delay_j;
8195
8196 /* UnitDelay: '<S115>/Unit_Delay' */
8197 L4_MABX_B.Unit_Delay_nm = L4_MABX_DW.Unit_Delay_DSTATE_omj;
8198
8199 /* Logic: '<S115>/Logical Operator1' incorporates:
8200 * Constant: '<S102>/CPV2'
8201 */
8202 L4_MABX_B.LogicalOperator1_ax = (L4_MABX_B.Unit_Delay_nm ||
8203 L4_MABX_P.CPV2_Value_m);
8204
8205 /* UnitDelay: '<S135>/Unit_Delay1' */
8206 L4_MABX_B.Unit_Delay1_i = L4_MABX_DW.Unit_Delay1_DSTATE_b;
8207
8208 /* Logic: '<S135>/Logical Operator' */
8209 L4_MABX_B.LogicalOperator_m = (L4_MABX_B.LogicalOperator1_ax ||
8210 L4_MABX_B.Unit_Delay1_i);
8211
8212 /* UnitDelay: '<S136>/Unit_Delay' */
8213 L4_MABX_B.Unit_Delay_nl = L4_MABX_DW.Unit_Delay_DSTATE_h4;
8214
8215 /* Logic: '<S136>/Logical Operator1' */
8216 L4_MABX_B.LogicalOperator1_mk = (L4_MABX_B.LogicalOperator1_ax ||
8217 L4_MABX_B.Unit_Delay_nl);
8218
8219 /* UnitDelay: '<S140>/FixPt Unit Delay2' */
8220 L4_MABX_B.FixPtUnitDelay2_op = L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm;
8221
8222 /* UnitDelay: '<S140>/FixPt Unit Delay1' */
8223 L4_MABX_B.Xold_g3 = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1;
8224
8225 /* Switch: '<S140>/Init' */
8226 if (L4_MABX_B.FixPtUnitDelay2_op != 0) {
8227 L4_MABX_B.Init_hw = L4_MABX_B.Brake_pressure_target_kpa;
8228 } else {
8229 L4_MABX_B.Init_hw = L4_MABX_B.Xold_g3;
8230 }
8231
8232 /* End of Switch: '<S140>/Init' */
8233
8234 /* Abs: '<S136>/Abs' incorporates:
8235 * Constant: '<S102>/CPV4'
8236 */
8237 L4_MABX_B.Abs_l = fabs(L4_MABX_P.CPV4_Value);
8238
8239 /* Product: '<S136>/Product1' */
8240 L4_MABX_B.Product1_b = L4_MABX_B.Abs_l * L4_MABX_B.Subtract_jr;
8241
8242 /* Sum: '<S136>/Add1' */
8243 L4_MABX_B.Add1_hu = L4_MABX_B.Init_hw + L4_MABX_B.Product1_b;
8244
8245 /* MinMax: '<S136>/MinMax2' */
8246 DeltaTime = L4_MABX_B.Brake_pressure_target_kpa;
8247 PositionFinalLimited = L4_MABX_B.Add1_hu;
8248 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8249 PositionFinalLimited = DeltaTime;
8250 }
8251
8252 L4_MABX_B.MinMax2_b = PositionFinalLimited;
8253
8254 /* End of MinMax: '<S136>/MinMax2' */
8255
8256 /* Abs: '<S136>/Abs1' incorporates:
8257 * Constant: '<S102>/CPV5'
8258 */
8259 L4_MABX_B.Abs1_d1 = fabs(L4_MABX_P.CPV5_Value);
8260
8261 /* Product: '<S136>/Product2' */
8262 L4_MABX_B.Product2_d = L4_MABX_B.Subtract_jr * L4_MABX_B.Abs1_d1;
8263
8264 /* Sum: '<S136>/Subtract1' */
8265 L4_MABX_B.Subtract1_a = L4_MABX_B.Init_hw - L4_MABX_B.Product2_d;
8266
8267 /* MinMax: '<S136>/MinMax1' */
8268 DeltaTime = L4_MABX_B.MinMax2_b;
8269 PositionFinalLimited = L4_MABX_B.Subtract1_a;
8270 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8271 PositionFinalLimited = DeltaTime;
8272 }
8273
8274 L4_MABX_B.MinMax1_ps = PositionFinalLimited;
8275
8276 /* End of MinMax: '<S136>/MinMax1' */
8277
8278 /* Outputs for Atomic SubSystem: '<S136>/If_Then_Else' */
8279 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_mk, L4_MABX_B.Gain_i,
8280 L4_MABX_B.MinMax1_ps, &L4_MABX_B.If_Then_Else_bg);
8281
8282 /* End of Outputs for SubSystem: '<S136>/If_Then_Else' */
8283
8284 /* Sum: '<S113>/Subtract' */
8285 L4_MABX_B.Subtract_n = L4_MABX_B.If_Then_Else_bg.Switch - L4_MABX_B.Gain_i;
8286
8287 /* MinMax: '<S135>/MinMax1' incorporates:
8288 * Constant: '<S102>/BRK_PRESS_DEM_T_FILT_CTRL_ERROR_APV'
8289 */
8290 DeltaTime = L4_MABX_B.Subtract_jr;
8291 PositionFinalLimited = L4_MABX_P.BRK_PRESS_DEM_T_FILT_CTRL_ERROR;
8292 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8293 PositionFinalLimited = DeltaTime;
8294 }
8295
8296 L4_MABX_B.MinMax1_h1 = PositionFinalLimited;
8297
8298 /* End of MinMax: '<S135>/MinMax1' */
8299
8300 /* Saturate: '<S135>/Saturation' */
8301 DeltaTime = L4_MABX_B.MinMax1_h1;
8302 Time56 = L4_MABX_P.Saturation_LowerSat;
8303 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat;
8304 if (DeltaTime > PositionFinalLimited) {
8305 L4_MABX_B.Saturation_p = PositionFinalLimited;
8306 } else if (DeltaTime < Time56) {
8307 L4_MABX_B.Saturation_p = Time56;
8308 } else {
8309 L4_MABX_B.Saturation_p = DeltaTime;
8310 }
8311
8312 /* End of Saturate: '<S135>/Saturation' */
8313
8314 /* Product: '<S135>/Divide' */
8315 L4_MABX_B.Divide_l = L4_MABX_B.Subtract_jr / L4_MABX_B.Saturation_p;
8316
8317 /* Product: '<S135>/Product2' */
8318 L4_MABX_B.Product2_kj = L4_MABX_B.Subtract_n * L4_MABX_B.Divide_l;
8319
8320 /* Sum: '<S135>/Subtract1' incorporates:
8321 * Constant: '<S135>/Constant1'
8322 */
8323 L4_MABX_B.Subtract1_p = L4_MABX_P.Constant1_Value_f - L4_MABX_B.Divide_l;
8324
8325 /* UnitDelay: '<S135>/Unit_Delay2' */
8326 L4_MABX_B.Unit_Delay2_d = L4_MABX_DW.Unit_Delay2_DSTATE_dy;
8327
8328 /* Product: '<S135>/Product1' */
8329 L4_MABX_B.Product1_c3 = L4_MABX_B.Subtract1_p * L4_MABX_B.Unit_Delay2_d;
8330
8331 /* Sum: '<S135>/Add1' */
8332 L4_MABX_B.Add1_i1 = L4_MABX_B.Product2_kj + L4_MABX_B.Product1_c3;
8333
8334 /* Outputs for Atomic SubSystem: '<S135>/If_Then_Else' */
8335 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_m, L4_MABX_B.Subtract_n,
8336 L4_MABX_B.Add1_i1, &L4_MABX_B.If_Then_Else_ly);
8337
8338 /* End of Outputs for SubSystem: '<S135>/If_Then_Else' */
8339
8340 /* RelationalOperator: '<S120>/Compare' incorporates:
8341 * Constant: '<S120>/Constant'
8342 */
8343 L4_MABX_B.Compare_aa = (L4_MABX_B.Abs1_ap >
8344 L4_MABX_P.CompareToConstant1_const);
8345
8346 /* Outputs for Enabled SubSystem: '<S112>/Calculate_D_term' */
8347
8348 /* Constant: '<S102>/BRK_PRESS_DEM_KD_APV' incorporates:
8349 * Constant: '<S102>/BRK_PRESS_DEM_T_FILT_D_APV'
8350 */
8351 L4_MABX_Calculate_D_term(L4_MABX_B.Compare_aa,
8352 L4_MABX_P.BRK_PRESS_DEM_KD_APV_Value, L4_MABX_B.Subtract_jr,
8353 L4_MABX_B.LogicalOperator1_ax, L4_MABX_B.If_Then_Else_ly.Switch,
8354 L4_MABX_P.BRK_PRESS_DEM_T_FILT_D_APV_Valu, &L4_MABX_B.Calculate_D_term,
8355 &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term);
8356
8357 /* End of Outputs for SubSystem: '<S112>/Calculate_D_term' */
8358
8359 /* Product: '<S118>/Product' incorporates:
8360 * Constant: '<S102>/BRK_PRESS_DEM_KP_APV'
8361 */
8362 L4_MABX_B.Product_iq = L4_MABX_P.BRK_PRESS_DEM_KP_APV_Value *
8363 L4_MABX_B.If_Then_Else_ly.Switch;
8364
8365 /* UnitDelay: '<S110>/Unit_Delay' */
8366 L4_MABX_B.Unit_Delay_ja = L4_MABX_DW.Unit_Delay_DSTATE_i;
8367
8368 /* RelationalOperator: '<S119>/Compare' incorporates:
8369 * Constant: '<S119>/Constant'
8370 */
8371 L4_MABX_B.Compare_jrp = (L4_MABX_B.Abs_k4 >
8372 L4_MABX_P.CompareToConstant_const);
8373
8374 /* Outputs for Enabled SubSystem: '<S112>/Calculate_I_term' */
8375
8376 /* Constant: '<S102>/BRK_PRESS_DEM_KI_APV' incorporates:
8377 * Constant: '<S102>/BRK_PRESS_DEM_AW_COND_INT_APV'
8378 * Constant: '<S102>/BRK_PRESS_DEM_AW_HYSTERESIS_APV'
8379 * Constant: '<S102>/CPV1'
8380 * Constant: '<S102>/CPV3'
8381 */
8382 L4_MABX_Calculate_I_term(L4_MABX_B.Compare_jrp, L4_MABX_B.Product_iq,
8383 L4_MABX_P.BRK_PRESS_DEM_KI_APV_Value, L4_MABX_B.Brake_appl_percent,
8384 L4_MABX_B.If_Then_Else_ly.Switch, L4_MABX_B.LogicalOperator1_ax,
8385 L4_MABX_B.Subtract_jr, L4_MABX_P.CPV3_Value,
8386 L4_MABX_P.BRK_PRESS_DEM_AW_COND_INT_APV_V,
8387 L4_MABX_P.BRK_PRESS_DEM_AW_HYSTERESIS_APV, L4_MABX_P.CPV1_Value_g,
8388 L4_MABX_B.Unit_Delay_ja, &L4_MABX_B.Calculate_I_term,
8389 &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term);
8390
8391 /* End of Outputs for SubSystem: '<S112>/Calculate_I_term' */
8392
8393 /* RelationalOperator: '<S138>/min_relop' incorporates:
8394 * Constant: '<S102>/CPV4'
8395 * Constant: '<S138>/min_val'
8396 */
8397 L4_MABX_B.min_relop_p = (L4_MABX_P.CheckStaticLowerBound_min <=
8398 L4_MABX_P.CPV4_Value);
8399
8400 /* Assertion: '<S138>/Assertion' */
8401 utAssert(L4_MABX_B.min_relop_p);
8402
8403 /* Sum: '<S114>/Add' incorporates:
8404 * Constant: '<S102>/CPV3'
8405 */
8406 L4_MABX_B.Add_e = ((L4_MABX_B.Product_iq +
8407 L4_MABX_B.Calculate_I_term.If_Then_Else.Switch) +
8408 L4_MABX_B.Calculate_D_term.Subtract) +
8409 L4_MABX_P.CPV3_Value;
8410
8411 /* RelationalOperator: '<S141>/Relational Operator1' incorporates:
8412 * Constant: '<S102>/CPV6'
8413 */
8414 L4_MABX_B.RelationalOperator1_gi = (L4_MABX_B.Add_e >= L4_MABX_P.CPV6_Value);
8415
8416 /* RelationalOperator: '<S141>/Relational Operator' incorporates:
8417 * Constant: '<S102>/CPV'
8418 */
8419 L4_MABX_B.RelationalOperator_b = (L4_MABX_B.Add_e <= L4_MABX_P.CPV_Value);
8420
8421 /* Outputs for Atomic SubSystem: '<S141>/If_Then_Else1' */
8422
8423 /* Constant: '<S102>/CPV' */
8424 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_b, L4_MABX_P.CPV_Value,
8425 L4_MABX_B.Add_e, &L4_MABX_B.If_Then_Else1_b);
8426
8427 /* End of Outputs for SubSystem: '<S141>/If_Then_Else1' */
8428
8429 /* Outputs for Atomic SubSystem: '<S141>/If_Then_Else' */
8430
8431 /* Constant: '<S102>/CPV6' */
8432 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_gi, L4_MABX_P.CPV6_Value,
8433 L4_MABX_B.If_Then_Else1_b.Switch,
8434 &L4_MABX_B.If_Then_Else_nj);
8435
8436 /* End of Outputs for SubSystem: '<S141>/If_Then_Else' */
8437 } else {
8438 if (L4_MABX_DW.Bendix_2C2_brake_application_pr) {
8439 /* Disable for Enabled SubSystem: '<S112>/Calculate_D_term' */
8440 if (L4_MABX_DW.Calculate_D_term.Calculate_D_term_MODE) {
8441 L4_Calculate_D_term_Disable(&L4_MABX_B.Calculate_D_term,
8442 &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term);
8443 }
8444
8445 /* End of Disable for SubSystem: '<S112>/Calculate_D_term' */
8446
8447 /* Disable for Enabled SubSystem: '<S112>/Calculate_I_term' */
8448 if (L4_MABX_DW.Calculate_I_term.Calculate_I_term_MODE) {
8449 L4_Calculate_I_term_Disable(&L4_MABX_B.Calculate_I_term,
8450 &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term);
8451 }
8452
8453 /* End of Disable for SubSystem: '<S112>/Calculate_I_term' */
8454
8455 /* Disable for Outport: '<S102>/PID_output' */
8456 L4_MABX_B.If_Then_Else_nj.Switch = L4_MABX_P.PID_output_Y0;
8457 L4_MABX_DW.Bendix_2C2_brake_application_pr = false;
8458 }
8459 }
8460
8461 /* End of Outputs for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */
8462
8463 /* RelationalOperator: '<S387>/Compare' incorporates:
8464 * Constant: '<S387>/Constant'
8465 */
8466 L4_MABX_B.Compare_ey = (L4_MABX_B.SFunction1_o4_o ==
8467 L4_MABX_P.CompareToConstant9_const);
8468
8469 /* RelationalOperator: '<S384>/Compare' incorporates:
8470 * Constant: '<S384>/Constant'
8471 */
8472 L4_MABX_B.Compare_jb = (L4_MABX_B.SFunction1_o5_m ==
8473 L4_MABX_P.CompareToConstant10_const);
8474
8475 /* RelationalOperator: '<S385>/Compare' incorporates:
8476 * Constant: '<S385>/Constant'
8477 */
8478 L4_MABX_B.Compare_hc = (L4_MABX_B.SFunction1_o6_n ==
8479 L4_MABX_P.CompareToConstant11_const);
8480
8481 /* RelationalOperator: '<S386>/Compare' incorporates:
8482 * Constant: '<S386>/Constant'
8483 */
8484 L4_MABX_B.Compare_bp = (L4_MABX_B.SFunction1_o7_f ==
8485 L4_MABX_P.CompareToConstant12_const);
8486
8487 /* Logic: '<S347>/Logical Operator2' */
8488 L4_MABX_B.LogicalOperator2_f5 = (L4_MABX_B.Compare_ey || L4_MABX_B.Compare_jb ||
8489 L4_MABX_B.Compare_hc || L4_MABX_B.Compare_bp);
8490
8491 /* UnitDelay: '<S389>/Unit_Delay' */
8492 L4_MABX_B.Unit_Delay_ot = L4_MABX_DW.Unit_Delay_DSTATE_cx;
8493
8494 /* Logic: '<S389>/Logical Operator1' */
8495 L4_MABX_B.LogicalOperator1_jo = !L4_MABX_B.Unit_Delay_ot;
8496
8497 /* Logic: '<S389>/Logical Operator' */
8498 L4_MABX_B.LogicalOperator_fl = (L4_MABX_B.LogicalOperator2_f5 &&
8499 L4_MABX_B.LogicalOperator1_jo);
8500
8501 /* UnitDelay: '<S390>/Unit_Delay' */
8502 L4_MABX_B.Unit_Delay_jz = L4_MABX_DW.Unit_Delay_DSTATE_d0;
8503
8504 /* Logic: '<S390>/Logical Operator1' */
8505 L4_MABX_B.LogicalOperator1_a = (L4_MABX_B.LogicalOperator_fl ||
8506 L4_MABX_B.Unit_Delay_jz);
8507
8508 /* UnitDelay: '<S347>/Unit_Delay' */
8509 L4_MABX_B.Unit_Delay_k = L4_MABX_DW.Unit_Delay_DSTATE_ef;
8510
8511 /* MinMax: '<S347>/MinMax' */
8512 DeltaTime = L4_MABX_B.Unit_Delay_k;
8513 PositionFinalLimited = L4_MABX_B.SFunction1_o1_ie;
8514 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8515 PositionFinalLimited = DeltaTime;
8516 }
8517
8518 L4_MABX_B.MinMax_d = PositionFinalLimited;
8519
8520 /* End of MinMax: '<S347>/MinMax' */
8521
8522 /* Outputs for Atomic SubSystem: '<S347>/If_Then_Else4' */
8523
8524 /* Constant: '<S347>/STABILITY_ACTIVE_VSPD_TARGET_APV' incorporates:
8525 * Constant: '<S347>/Constant4'
8526 */
8527 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator2_f5,
8528 L4_MABX_P.STABILITY_ACTIVE_VSPD_TARGET_AP,
8529 L4_MABX_P.Constant4_Value_n, &L4_MABX_B.If_Then_Else4_h);
8530
8531 /* End of Outputs for SubSystem: '<S347>/If_Then_Else4' */
8532
8533 /* UnitDelay: '<S394>/FixPt Unit Delay2' */
8534 L4_MABX_B.FixPtUnitDelay2_b = L4_MABX_DW.FixPtUnitDelay2_DSTATE_a;
8535
8536 /* UnitDelay: '<S394>/FixPt Unit Delay1' */
8537 L4_MABX_B.Xold_hq = L4_MABX_DW.FixPtUnitDelay1_DSTATE_hj;
8538
8539 /* Switch: '<S394>/Init' */
8540 if (L4_MABX_B.FixPtUnitDelay2_b != 0) {
8541 L4_MABX_B.Init_i = L4_MABX_B.If_Then_Else4_h.Switch;
8542 } else {
8543 L4_MABX_B.Init_i = L4_MABX_B.Xold_hq;
8544 }
8545
8546 /* End of Switch: '<S394>/Init' */
8547
8548 /* Abs: '<S390>/Abs' incorporates:
8549 * Constant: '<S347>/STABILITY_CTRL_SLEW_INC_APV'
8550 */
8551 L4_MABX_B.Abs_e = fabs(L4_MABX_P.STABILITY_CTRL_SLEW_INC_APV_Val);
8552
8553 /* DigitalClock: '<S391>/Digital Clock' */
8554 L4_MABX_B.DigitalClock = L4_MABX_M->Timing.t[0];
8555
8556 /* UnitDelay: '<S391>/Unit_Delay' */
8557 L4_MABX_B.Unit_Delay_d = L4_MABX_DW.Unit_Delay_DSTATE_m;
8558
8559 /* Sum: '<S391>/Subtract' */
8560 L4_MABX_B.Subtract_l = L4_MABX_B.DigitalClock - L4_MABX_B.Unit_Delay_d;
8561
8562 /* Product: '<S390>/Product1' */
8563 L4_MABX_B.Product1_hp = L4_MABX_B.Abs_e * L4_MABX_B.Subtract_l;
8564
8565 /* Sum: '<S390>/Add1' */
8566 L4_MABX_B.Add1_nd = L4_MABX_B.Init_i + L4_MABX_B.Product1_hp;
8567
8568 /* MinMax: '<S390>/MinMax2' */
8569 DeltaTime = L4_MABX_B.If_Then_Else4_h.Switch;
8570 PositionFinalLimited = L4_MABX_B.Add1_nd;
8571 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8572 PositionFinalLimited = DeltaTime;
8573 }
8574
8575 L4_MABX_B.MinMax2_g = PositionFinalLimited;
8576
8577 /* End of MinMax: '<S390>/MinMax2' */
8578
8579 /* Abs: '<S390>/Abs1' incorporates:
8580 * Constant: '<S347>/STABILITY_CTRL_SLEW_DEC_APV'
8581 */
8582 L4_MABX_B.Abs1_h = fabs(L4_MABX_P.STABILITY_CTRL_SLEW_DEC_APV_Val);
8583
8584 /* Product: '<S390>/Product2' */
8585 L4_MABX_B.Product2_c = L4_MABX_B.Subtract_l * L4_MABX_B.Abs1_h;
8586
8587 /* Sum: '<S390>/Subtract1' */
8588 L4_MABX_B.Subtract1_n = L4_MABX_B.Init_i - L4_MABX_B.Product2_c;
8589
8590 /* MinMax: '<S390>/MinMax1' */
8591 DeltaTime = L4_MABX_B.MinMax2_g;
8592 PositionFinalLimited = L4_MABX_B.Subtract1_n;
8593 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8594 PositionFinalLimited = DeltaTime;
8595 }
8596
8597 L4_MABX_B.MinMax1_hj = PositionFinalLimited;
8598
8599 /* End of MinMax: '<S390>/MinMax1' */
8600
8601 /* Outputs for Atomic SubSystem: '<S390>/If_Then_Else' */
8602 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_a, L4_MABX_B.MinMax_d,
8603 L4_MABX_B.MinMax1_hj, &L4_MABX_B.If_Then_Else_m4);
8604
8605 /* End of Outputs for SubSystem: '<S390>/If_Then_Else' */
8606
8607 /* RelationalOperator: '<S375>/Compare' incorporates:
8608 * Constant: '<S375>/Constant'
8609 */
8610 L4_MABX_B.Compare_d3 = (L4_MABX_B.ACCDistanceAlertSignal ==
8611 L4_MABX_P.CompareToConstant3_const);
8612
8613 /* RelationalOperator: '<S376>/Compare' incorporates:
8614 * Constant: '<S376>/Constant'
8615 */
8616 L4_MABX_B.Compare_dv = (L4_MABX_B.ForwardCollisionWarning ==
8617 L4_MABX_P.CompareToConstant8_const);
8618
8619 /* Logic: '<S345>/Logical Operator1' */
8620 L4_MABX_B.LogicalOperator1_g = (L4_MABX_B.Compare_d3 || L4_MABX_B.Compare_dv);
8621
8622 /* UnitDelay: '<S378>/Unit_Delay' */
8623 L4_MABX_B.Unit_Delay_h = L4_MABX_DW.Unit_Delay_DSTATE_iy;
8624
8625 /* Logic: '<S378>/Logical Operator1' */
8626 L4_MABX_B.LogicalOperator1_jp = !L4_MABX_B.Unit_Delay_h;
8627
8628 /* Logic: '<S378>/Logical Operator' */
8629 L4_MABX_B.LogicalOperator_kf = (L4_MABX_B.LogicalOperator1_g &&
8630 L4_MABX_B.LogicalOperator1_jp);
8631
8632 /* UnitDelay: '<S379>/Unit_Delay' */
8633 L4_MABX_B.Unit_Delay_c4 = L4_MABX_DW.Unit_Delay_DSTATE_mv;
8634
8635 /* Logic: '<S379>/Logical Operator1' */
8636 L4_MABX_B.LogicalOperator1_l4 = (L4_MABX_B.LogicalOperator_kf ||
8637 L4_MABX_B.Unit_Delay_c4);
8638
8639 /* UnitDelay: '<S345>/Unit_Delay' */
8640 L4_MABX_B.Unit_Delay_nc = L4_MABX_DW.Unit_Delay_DSTATE_g;
8641
8642 /* MinMax: '<S345>/MinMax' */
8643 DeltaTime = L4_MABX_B.Unit_Delay_nc;
8644 PositionFinalLimited = L4_MABX_B.SFunction1_o1_ie;
8645 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8646 PositionFinalLimited = DeltaTime;
8647 }
8648
8649 L4_MABX_B.MinMax_n = PositionFinalLimited;
8650
8651 /* End of MinMax: '<S345>/MinMax' */
8652
8653 /* Outputs for Atomic SubSystem: '<S345>/If_Then_Else4' */
8654
8655 /* Constant: '<S345>/FCW_ACTIVE_VSPD_TARGET_APV' incorporates:
8656 * Constant: '<S345>/Constant4'
8657 */
8658 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_g,
8659 L4_MABX_P.FCW_ACTIVE_VSPD_TARGET_APV_Valu,
8660 L4_MABX_P.Constant4_Value_b, &L4_MABX_B.If_Then_Else4_e);
8661
8662 /* End of Outputs for SubSystem: '<S345>/If_Then_Else4' */
8663
8664 /* UnitDelay: '<S383>/FixPt Unit Delay2' */
8665 L4_MABX_B.FixPtUnitDelay2_pl = L4_MABX_DW.FixPtUnitDelay2_DSTATE_ip;
8666
8667 /* UnitDelay: '<S383>/FixPt Unit Delay1' */
8668 L4_MABX_B.Xold_fv = L4_MABX_DW.FixPtUnitDelay1_DSTATE_hq;
8669
8670 /* Switch: '<S383>/Init' */
8671 if (L4_MABX_B.FixPtUnitDelay2_pl != 0) {
8672 L4_MABX_B.Init_b = L4_MABX_B.If_Then_Else4_e.Switch;
8673 } else {
8674 L4_MABX_B.Init_b = L4_MABX_B.Xold_fv;
8675 }
8676
8677 /* End of Switch: '<S383>/Init' */
8678
8679 /* Abs: '<S379>/Abs' incorporates:
8680 * Constant: '<S345>/FCW_CTRL_SLEW_INC_APV'
8681 */
8682 L4_MABX_B.Abs_ez = fabs(L4_MABX_P.FCW_CTRL_SLEW_INC_APV_Value);
8683
8684 /* DigitalClock: '<S380>/Digital Clock' */
8685 L4_MABX_B.DigitalClock_b = L4_MABX_M->Timing.t[0];
8686
8687 /* UnitDelay: '<S380>/Unit_Delay' */
8688 L4_MABX_B.Unit_Delay_nx = L4_MABX_DW.Unit_Delay_DSTATE_b;
8689
8690 /* Sum: '<S380>/Subtract' */
8691 L4_MABX_B.Subtract_i = L4_MABX_B.DigitalClock_b - L4_MABX_B.Unit_Delay_nx;
8692
8693 /* Product: '<S379>/Product1' */
8694 L4_MABX_B.Product1_i = L4_MABX_B.Abs_ez * L4_MABX_B.Subtract_i;
8695
8696 /* Sum: '<S379>/Add1' */
8697 L4_MABX_B.Add1_b = L4_MABX_B.Init_b + L4_MABX_B.Product1_i;
8698
8699 /* MinMax: '<S379>/MinMax2' */
8700 DeltaTime = L4_MABX_B.If_Then_Else4_e.Switch;
8701 PositionFinalLimited = L4_MABX_B.Add1_b;
8702 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8703 PositionFinalLimited = DeltaTime;
8704 }
8705
8706 L4_MABX_B.MinMax2_k = PositionFinalLimited;
8707
8708 /* End of MinMax: '<S379>/MinMax2' */
8709
8710 /* Abs: '<S379>/Abs1' incorporates:
8711 * Constant: '<S345>/FCW_CTRL_SLEW_DEC_APV'
8712 */
8713 L4_MABX_B.Abs1_c = fabs(L4_MABX_P.FCW_CTRL_SLEW_DEC_APV_Value);
8714
8715 /* Product: '<S379>/Product2' */
8716 L4_MABX_B.Product2_n = L4_MABX_B.Subtract_i * L4_MABX_B.Abs1_c;
8717
8718 /* Sum: '<S379>/Subtract1' */
8719 L4_MABX_B.Subtract1_h = L4_MABX_B.Init_b - L4_MABX_B.Product2_n;
8720
8721 /* MinMax: '<S379>/MinMax1' */
8722 DeltaTime = L4_MABX_B.MinMax2_k;
8723 PositionFinalLimited = L4_MABX_B.Subtract1_h;
8724 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8725 PositionFinalLimited = DeltaTime;
8726 }
8727
8728 L4_MABX_B.MinMax1_j = PositionFinalLimited;
8729
8730 /* End of MinMax: '<S379>/MinMax1' */
8731
8732 /* Outputs for Atomic SubSystem: '<S379>/If_Then_Else' */
8733 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_l4, L4_MABX_B.MinMax_n,
8734 L4_MABX_B.MinMax1_j, &L4_MABX_B.If_Then_Else_bf);
8735
8736 /* End of Outputs for SubSystem: '<S379>/If_Then_Else' */
8737
8738 /* RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' */
8739 if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) {
8740 L4_MABX_B.pathSpdLimit_a = L4_MABX_DW.TmpRTBAtSignalConversion3Inport;
8741 }
8742
8743 /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates:
8744 * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV'
8745 */
8746 switch (LONG_SPEED_SRC_SELECTOR_APV) {
8747 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH:
8748 /* SignalConversion: '<S81>/Signal Conversion3' */
8749 L4_MABX_B.Vehicle_speed_abs_max_e = L4_MABX_B.pathSpdLimit_a;
8750 L4_MABX_B.Vehicle_speed_abs_max = L4_MABX_B.Vehicle_speed_abs_max_e;
8751 break;
8752
8753 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE:
8754 /* SignalConversion: '<S81>/Signal Conversion8' incorporates:
8755 * Constant: '<S81>/VSPD_ABS_MAX_APV'
8756 */
8757 L4_MABX_B.Vehicle_speed_abs_max_j = L4_MABX_P.VSPD_ABS_MAX_APV_Value;
8758 L4_MABX_B.Vehicle_speed_abs_max = L4_MABX_B.Vehicle_speed_abs_max_j;
8759 break;
8760
8761 default:
8762 /* SignalConversion: '<S81>/Signal Conversion15' incorporates:
8763 * Constant: '<S81>/CPV1'
8764 */
8765 L4_MABX_B.Vehicle_speed_abs_max_g = L4_MABX_P.CPV1_Value;
8766 L4_MABX_B.Vehicle_speed_abs_max = L4_MABX_B.Vehicle_speed_abs_max_g;
8767 break;
8768 }
8769
8770 /* RelationalOperator: '<S341>/Compare' incorporates:
8771 * Constant: '<S341>/Constant'
8772 */
8773 L4_MABX_B.Compare_jr = (L4_MABX_B.SFunction1_o7_au ==
8774 L4_MABX_P.Constant_Value_a);
8775
8776 /* RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' */
8777 if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) {
8778 L4_MABX_B.distance_o = L4_MABX_DW.TmpRTBAtSignalConversion2Inport;
8779 }
8780
8781 /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates:
8782 * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV'
8783 */
8784 switch (LONG_SPEED_SRC_SELECTOR_APV) {
8785 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH:
8786 /* SignalConversion: '<S81>/Signal Conversion2' */
8787 L4_MABX_B.Distance_to_achieve_speed_tar_f = L4_MABX_B.distance_o;
8788 L4_MABX_B.Distance_to_achieve_speed_targe =
8789 L4_MABX_B.Distance_to_achieve_speed_tar_f;
8790 break;
8791
8792 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE:
8793 /* SignalConversion: '<S81>/Signal Conversion7' incorporates:
8794 * Constant: '<S81>/DISTANCE_M'
8795 */
8796 L4_MABX_B.Distance_to_achieve_speed_tar_j = DISTANCE_M;
8797 L4_MABX_B.Distance_to_achieve_speed_targe =
8798 L4_MABX_B.Distance_to_achieve_speed_tar_j;
8799 break;
8800
8801 default:
8802 /* SignalConversion: '<S81>/Signal Conversion14' incorporates:
8803 * Constant: '<S81>/CPV'
8804 */
8805 L4_MABX_B.Distance_to_achieve_speed_tar_m = L4_MABX_P.CPV_Value_ia;
8806 L4_MABX_B.Distance_to_achieve_speed_targe =
8807 L4_MABX_B.Distance_to_achieve_speed_tar_m;
8808 break;
8809 }
8810
8811 /* UnitDelay: '<S342>/Delay Input1' */
8812 L4_MABX_B.Uk1[0] = L4_MABX_DW.DelayInput1_DSTATE[0];
8813 L4_MABX_B.Uk1[1] = L4_MABX_DW.DelayInput1_DSTATE[1];
8814
8815 /* RelationalOperator: '<S342>/FixPt Relational Operator' */
8816 L4_MABX_B.FixPtRelationalOperator_dk[0] =
8817 (L4_MABX_B.Distance_to_achieve_speed_targe != L4_MABX_B.Uk1[0]);
8818 L4_MABX_B.FixPtRelationalOperator_dk[1] = (L4_MABX_B.Vehicle_speed_target_o !=
8819 L4_MABX_B.Uk1[1]);
8820
8821 /* Logic: '<S81>/Logical Operator1' */
8822 L4_MABX_B.LogicalOperator1_ja = (L4_MABX_B.FixPtRelationalOperator_dk[0] ||
8823 L4_MABX_B.FixPtRelationalOperator_dk[1]);
8824
8825 /* Saturate: '<S344>/Saturation5' */
8826 DeltaTime = L4_MABX_B.SFunction1_o1_ie;
8827 Time56 = L4_MABX_P.Saturation5_LowerSat;
8828 PositionFinalLimited = L4_MABX_P.Saturation5_UpperSat;
8829 if (DeltaTime > PositionFinalLimited) {
8830 L4_MABX_B.Saturation5 = PositionFinalLimited;
8831 } else if (DeltaTime < Time56) {
8832 L4_MABX_B.Saturation5 = Time56;
8833 } else {
8834 L4_MABX_B.Saturation5 = DeltaTime;
8835 }
8836
8837 /* End of Saturate: '<S344>/Saturation5' */
8838
8839 /* MinMax: '<S344>/MinMax6' incorporates:
8840 * Constant: '<S344>/MIN_VSPD_SIGMOID_INITIAL_KPH_APV'
8841 */
8842 DeltaTime = L4_MABX_B.Saturation5;
8843 PositionFinalLimited = L4_MABX_P.MIN_VSPD_SIGMOID_INITIAL_KPH_AP;
8844 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8845 PositionFinalLimited = DeltaTime;
8846 }
8847
8848 L4_MABX_B.MinMax6 = PositionFinalLimited;
8849
8850 /* End of MinMax: '<S344>/MinMax6' */
8851
8852 /* Gain: '<S344>/Gain1' */
8853 L4_MABX_B.Gain1_e = L4_MABX_P.Gain1_Gain_a * L4_MABX_B.MinMax6;
8854
8855 /* Saturate: '<S344>/Saturation4' */
8856 DeltaTime = L4_MABX_B.Vehicle_speed_target_o;
8857 Time56 = L4_MABX_P.Saturation4_LowerSat;
8858 PositionFinalLimited = L4_MABX_P.Saturation4_UpperSat;
8859 if (DeltaTime > PositionFinalLimited) {
8860 L4_MABX_B.VSPD_TARGET_KPH_APV_gu = PositionFinalLimited;
8861 } else if (DeltaTime < Time56) {
8862 L4_MABX_B.VSPD_TARGET_KPH_APV_gu = Time56;
8863 } else {
8864 L4_MABX_B.VSPD_TARGET_KPH_APV_gu = DeltaTime;
8865 }
8866
8867 /* End of Saturate: '<S344>/Saturation4' */
8868
8869 /* MinMax: '<S344>/MinMax1' incorporates:
8870 * Constant: '<S344>/MIN_VSPD_SIGMOID_FINAL_KPH_APV'
8871 */
8872 DeltaTime = L4_MABX_B.VSPD_TARGET_KPH_APV_gu;
8873 PositionFinalLimited = L4_MABX_P.MIN_VSPD_SIGMOID_FINAL_KPH_APV_;
8874 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
8875 PositionFinalLimited = DeltaTime;
8876 }
8877
8878 L4_MABX_B.MinMax1_f = PositionFinalLimited;
8879
8880 /* End of MinMax: '<S344>/MinMax1' */
8881
8882 /* Gain: '<S344>/Gain2' */
8883 L4_MABX_B.Gain2 = L4_MABX_P.Gain2_Gain_k * L4_MABX_B.MinMax1_f;
8884
8885 /* Saturate: '<S344>/Saturation6' */
8886 DeltaTime = SPN1810_LongitudinalAcceleration;
8887 Time56 = L4_MABX_P.Saturation6_LowerSat;
8888 PositionFinalLimited = L4_MABX_P.Saturation6_UpperSat;
8889 if (DeltaTime > PositionFinalLimited) {
8890 L4_MABX_B.Saturation6 = PositionFinalLimited;
8891 } else if (DeltaTime < Time56) {
8892 L4_MABX_B.Saturation6 = Time56;
8893 } else {
8894 L4_MABX_B.Saturation6 = DeltaTime;
8895 }
8896
8897 /* End of Saturate: '<S344>/Saturation6' */
8898
8899 /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates:
8900 * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV'
8901 */
8902 switch (LONG_SPEED_SRC_SELECTOR_APV) {
8903 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH:
8904 /* SignalConversion: '<S81>/Signal Conversion10' incorporates:
8905 * Constant: '<S81>/CPV3'
8906 */
8907 L4_MABX_B.Acceleration_target_ms2_d = L4_MABX_P.CPV3_Value_l;
8908 L4_MABX_B.Acceleration_target_ms2 = L4_MABX_B.Acceleration_target_ms2_d;
8909 break;
8910
8911 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE:
8912 /* SignalConversion: '<S81>/Signal Conversion5' incorporates:
8913 * Constant: '<S81>/VEH_ACCEL_TARGET_APV'
8914 */
8915 L4_MABX_B.Acceleration_target_ms2_h = L4_MABX_P.VEH_ACCEL_TARGET_APV_Value;
8916 L4_MABX_B.Acceleration_target_ms2 = L4_MABX_B.Acceleration_target_ms2_h;
8917 break;
8918
8919 default:
8920 /* SignalConversion: '<S81>/Signal Conversion11' incorporates:
8921 * Constant: '<S81>/CPV2'
8922 */
8923 L4_MABX_B.Acceleration_target_ms2_f = L4_MABX_P.CPV2_Value;
8924 L4_MABX_B.Acceleration_target_ms2 = L4_MABX_B.Acceleration_target_ms2_f;
8925 break;
8926 }
8927
8928 /* Saturate: '<S344>/Saturation7' */
8929 DeltaTime = L4_MABX_B.Acceleration_target_ms2;
8930 Time56 = L4_MABX_P.Saturation7_LowerSat;
8931 PositionFinalLimited = L4_MABX_P.Saturation7_UpperSat;
8932 if (DeltaTime > PositionFinalLimited) {
8933 L4_MABX_B.Saturation7 = PositionFinalLimited;
8934 } else if (DeltaTime < Time56) {
8935 L4_MABX_B.Saturation7 = Time56;
8936 } else {
8937 L4_MABX_B.Saturation7 = DeltaTime;
8938 }
8939
8940 /* End of Saturate: '<S344>/Saturation7' */
8941
8942 /* Saturate: '<S344>/Saturation1' incorporates:
8943 * Constant: '<S81>/VEH_JERK_INITIAL_APV'
8944 */
8945 DeltaTime = L4_MABX_P.VEH_JERK_INITIAL_APV_Value;
8946 Time56 = L4_MABX_P.Saturation1_LowerSat_b;
8947 PositionFinalLimited = L4_MABX_P.Saturation1_UpperSat_o;
8948 if (DeltaTime > PositionFinalLimited) {
8949 L4_MABX_B.Saturation1 = PositionFinalLimited;
8950 } else if (DeltaTime < Time56) {
8951 L4_MABX_B.Saturation1 = Time56;
8952 } else {
8953 L4_MABX_B.Saturation1 = DeltaTime;
8954 }
8955
8956 /* End of Saturate: '<S344>/Saturation1' */
8957
8958 /* MultiPortSwitch: '<S81>/Multiport Switch' incorporates:
8959 * Constant: '<S81>/LONG_SPEED_SRC_SELECTOR_APV'
8960 */
8961 switch (LONG_SPEED_SRC_SELECTOR_APV) {
8962 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH:
8963 /* SignalConversion: '<S81>/Signal Conversion13' incorporates:
8964 * Constant: '<S81>/CPV4'
8965 */
8966 L4_MABX_B.Jerk_target_ms3_g = L4_MABX_P.CPV4_Value_k;
8967 L4_MABX_B.Jerk_target_ms3 = L4_MABX_B.Jerk_target_ms3_g;
8968 break;
8969
8970 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE:
8971 /* SignalConversion: '<S81>/Signal Conversion6' incorporates:
8972 * Constant: '<S81>/VEH_JERK_TARGET_APV'
8973 */
8974 L4_MABX_B.Jerk_target_ms3_d = L4_MABX_P.VEH_JERK_TARGET_APV_Value;
8975 L4_MABX_B.Jerk_target_ms3 = L4_MABX_B.Jerk_target_ms3_d;
8976 break;
8977
8978 default:
8979 /* SignalConversion: '<S81>/Signal Conversion12' incorporates:
8980 * Constant: '<S81>/CPV5'
8981 */
8982 L4_MABX_B.Jerk_target_ms3_l = L4_MABX_P.CPV5_Value_n;
8983 L4_MABX_B.Jerk_target_ms3 = L4_MABX_B.Jerk_target_ms3_l;
8984 break;
8985 }
8986
8987 /* Saturate: '<S344>/Saturation2' */
8988 DeltaTime = L4_MABX_B.Jerk_target_ms3;
8989 Time56 = L4_MABX_P.Saturation2_LowerSat;
8990 PositionFinalLimited = L4_MABX_P.Saturation2_UpperSat;
8991 if (DeltaTime > PositionFinalLimited) {
8992 L4_MABX_B.Saturation2 = PositionFinalLimited;
8993 } else if (DeltaTime < Time56) {
8994 L4_MABX_B.Saturation2 = Time56;
8995 } else {
8996 L4_MABX_B.Saturation2 = DeltaTime;
8997 }
8998
8999 /* End of Saturate: '<S344>/Saturation2' */
9000
9001 /* Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */
9002 /* Gateway: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/VehicleSpeedSetpointDynamicCalculation */
9003 /* During: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/VehicleSpeedSetpointDynamicCalculation */
9004 /* Entry Internal: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/VehicleSpeedSetpointDynamicCalculation */
9005 /* Transition: '<S359>:88' */
9006 if (L4_MABX_B.LogicalOperator1_ja) {
9007 /* Transition: '<S359>:89' */
9008 /* Transition: '<S359>:39' */
9009 PositionFinalLimited = L4_MABX_B.Distance_to_achieve_speed_targe;
9010 if ((0.001 > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
9011 PositionFinalLimited = 0.001;
9012 }
9013
9014 Time56 = L4_MABX_B.Gain1_e;
9015 if ((0.1 > Time56) || rtIsNaN(Time56)) {
9016 L4_MABX_DW.VelocityInitialLimited = 0.1;
9017 } else {
9018 L4_MABX_DW.VelocityInitialLimited = Time56;
9019 }
9020
9021 Time56 = L4_MABX_B.Gain2;
9022 if ((0.1 > Time56) || rtIsNaN(Time56)) {
9023 L4_MABX_DW.VelocityFinalLimited = 0.1;
9024 } else {
9025 L4_MABX_DW.VelocityFinalLimited = Time56;
9026 }
9027
9028 L4_MABX_DW.TimeFinal = 2.0 * PositionFinalLimited /
9029 (L4_MABX_DW.VelocityInitialLimited + L4_MABX_DW.VelocityFinalLimited);
9030 Time56 = L4_MABX_DW.TimeFinal;
9031 if ((0.007 > Time56) || rtIsNaN(Time56)) {
9032 L4_MABX_DW.TimeFinal = 0.007;
9033 } else {
9034 L4_MABX_DW.TimeFinal = Time56;
9035 }
9036
9037 AccelerationAverage = (L4_MABX_DW.VelocityFinalLimited -
9038 L4_MABX_DW.VelocityInitialLimited) / L4_MABX_DW.TimeFinal;
9039 L4_MABX_DW.TimeFinal *= 2.0;
9040 if (L4_MABX_DW.VelocityFinalLimited > L4_MABX_DW.VelocityInitialLimited) {
9041 /* Transition: '<S359>:238' */
9042 /* Transition: '<S359>:240' */
9043 Time56 = L4_MABX_B.Saturation6;
9044 if ((AccelerationAverage < Time56) || rtIsNaN(Time56)) {
9045 Time56 = AccelerationAverage;
9046 }
9047
9048 if ((0.0 > Time56) || rtIsNaN(Time56)) {
9049 L4_MABX_DW.AccelerationInitialLimited = 0.0;
9050 } else {
9051 L4_MABX_DW.AccelerationInitialLimited = Time56;
9052 }
9053
9054 Time56 = L4_MABX_B.Saturation7;
9055 if ((AccelerationAverage < Time56) || rtIsNaN(Time56)) {
9056 Time56 = AccelerationAverage;
9057 }
9058
9059 if ((0.0 > Time56) || rtIsNaN(Time56)) {
9060 L4_MABX_DW.AccelerationFinalLimited = 0.0;
9061 } else {
9062 L4_MABX_DW.AccelerationFinalLimited = Time56;
9063 }
9064
9065 /* Transition: '<S359>:243' */
9066 } else {
9067 /* Transition: '<S359>:241' */
9068 Time56 = L4_MABX_B.Saturation6;
9069 if ((0.0 < Time56) || rtIsNaN(Time56)) {
9070 Time56 = 0.0;
9071 }
9072
9073 if ((AccelerationAverage > Time56) || rtIsNaN(Time56)) {
9074 L4_MABX_DW.AccelerationInitialLimited = AccelerationAverage;
9075 } else {
9076 L4_MABX_DW.AccelerationInitialLimited = Time56;
9077 }
9078
9079 Time56 = L4_MABX_B.Saturation7;
9080 if ((0.0 < Time56) || rtIsNaN(Time56)) {
9081 Time56 = 0.0;
9082 }
9083
9084 if ((AccelerationAverage > Time56) || rtIsNaN(Time56)) {
9085 L4_MABX_DW.AccelerationFinalLimited = AccelerationAverage;
9086 } else {
9087 L4_MABX_DW.AccelerationFinalLimited = Time56;
9088 }
9089 }
9090
9091 /* Transition: '<S359>:16' */
9092 DeltaTimeFinal = L4_MABX_DW.TimeFinal;
9093 for (starting_index = 1U; starting_index < 16; starting_index++) {
9094 /* Transition: '<S359>:14' */
9095 /* Transition: '<S359>:201' */
9096 DeltaTime = ((L4_MABX_DW.VelocityInitialLimited -
9097 L4_MABX_DW.VelocityFinalLimited) +
9098 L4_MABX_DW.AccelerationFinalLimited * L4_MABX_DW.TimeFinal) *
9099 2.0 / (L4_MABX_DW.TimeFinal * L4_MABX_DW.TimeFinal);
9100 if (L4_MABX_DW.VelocityFinalLimited > L4_MABX_DW.VelocityInitialLimited) {
9101 /* Transition: '<S359>:121' */
9102 /* Transition: '<S359>:116' */
9103 L4_MABX_DW.Jerk12 = L4_MABX_B.Saturation1;
9104 DeltaTime = fabs(DeltaTime);
9105 Time56 = L4_MABX_B.Saturation2;
9106 if ((DeltaTime > Time56) || rtIsNaN(Time56)) {
9107 Time56 = DeltaTime;
9108 }
9109
9110 L4_MABX_DW.Jerk56 = -Time56;
9111
9112 /* Transition: '<S359>:120' */
9113 } else {
9114 /* Transition: '<S359>:122' */
9115 L4_MABX_DW.Jerk12 = -L4_MABX_B.Saturation1;
9116 DeltaTime = fabs(DeltaTime);
9117 Time56 = L4_MABX_B.Saturation2;
9118 if ((DeltaTime > Time56) || rtIsNaN(Time56)) {
9119 L4_MABX_DW.Jerk56 = DeltaTime;
9120 } else {
9121 L4_MABX_DW.Jerk56 = Time56;
9122 }
9123 }
9124
9125 /* Transition: '<S359>:275' */
9126 L4_MABX_CalculateAcceleration34();
9127 if (fabs(L4_MABX_DW.Acceleration34 - AccelerationAverage) < 0.001) {
9128 /* Transition: '<S359>:141' */
9129 /* Transition: '<S359>:145' */
9130 L4_MABX_B.TimeVectorRaw[0] = 0.0;
9131 L4_MABX_B.TimeVectorRaw[1] = 0.001;
9132 L4_MABX_B.TimeVectorRaw[2] = 0.003;
9133 L4_MABX_B.TimeVectorRaw[3] = (L4_MABX_DW.TimeFinal - 0.002) - 0.001;
9134 L4_MABX_B.TimeVectorRaw[4] = (L4_MABX_DW.TimeFinal - 0.002) + 0.001;
9135 L4_MABX_B.TimeVectorRaw[5] = L4_MABX_DW.TimeFinal;
9136 for (i = 0; i < 6; i++) {
9137 L4_MABX_B.JerkVectorRaw[i] = 0.0;
9138 }
9139
9140 L4_MABX_B.AccelerationVectorRaw[0] = AccelerationAverage;
9141
9142 /* Transition: '<S359>:191' */
9143 /* Transition: '<S359>:303' */
9144 } else {
9145 /* Transition: '<S359>:298' */
9146 if (L4_MABX_DW.AlternateMethod) {
9147 /* Transition: '<S359>:300' */
9148 /* Transition: '<S359>:302' */
9149 Time56 = (L4_MABX_DW.AccelerationFinalLimited -
9150 L4_MABX_DW.Acceleration34) / L4_MABX_DW.Jerk56;
9151 if ((0.002 > Time56) || rtIsNaN(Time56)) {
9152 Time56 = 0.002;
9153 }
9154
9155 L4_MABX_B.TimeVectorRaw[0] = 0.0;
9156 L4_MABX_B.TimeVectorRaw[1] = 0.001;
9157 L4_MABX_B.TimeVectorRaw[2] = 0.003;
9158 L4_MABX_B.TimeVectorRaw[3] = (L4_MABX_DW.TimeFinal - Time56) - 0.001;
9159 L4_MABX_B.TimeVectorRaw[4] = (L4_MABX_DW.TimeFinal - Time56) + 0.001;
9160 L4_MABX_B.TimeVectorRaw[5] = L4_MABX_DW.TimeFinal;
9161 L4_MABX_B.JerkVectorRaw[0] = 0.0;
9162 L4_MABX_B.JerkVectorRaw[1] = 0.0;
9163 L4_MABX_B.JerkVectorRaw[2] = 0.0;
9164 L4_MABX_B.JerkVectorRaw[3] = 0.0;
9165 L4_MABX_B.JerkVectorRaw[4] = L4_MABX_DW.Jerk56;
9166 L4_MABX_B.JerkVectorRaw[5] = L4_MABX_DW.Jerk56;
9167 L4_MABX_B.AccelerationVectorRaw[0] = L4_MABX_DW.Acceleration34;
9168
9169 /* Transition: '<S359>:303' */
9170 } else {
9171 /* Transition: '<S359>:157' */
9172 DeltaTime = (L4_MABX_DW.Acceleration34 -
9173 L4_MABX_DW.AccelerationInitialLimited) /
9174 L4_MABX_DW.Jerk12;
9175 if ((0.002 > DeltaTime) || rtIsNaN(DeltaTime)) {
9176 DeltaTime = 0.002;
9177 }
9178
9179 Time56 = (L4_MABX_DW.AccelerationFinalLimited -
9180 L4_MABX_DW.Acceleration34) / L4_MABX_DW.Jerk56;
9181 if ((0.002 > Time56) || rtIsNaN(Time56)) {
9182 Time56 = 0.002;
9183 }
9184
9185 L4_MABX_B.TimeVectorRaw[0] = 0.0;
9186 L4_MABX_B.TimeVectorRaw[1] = DeltaTime - 0.001;
9187 L4_MABX_B.TimeVectorRaw[2] = DeltaTime + 0.001;
9188 L4_MABX_B.TimeVectorRaw[3] = (L4_MABX_DW.TimeFinal - Time56) - 0.001;
9189 L4_MABX_B.TimeVectorRaw[4] = (L4_MABX_DW.TimeFinal - Time56) + 0.001;
9190 L4_MABX_B.TimeVectorRaw[5] = L4_MABX_DW.TimeFinal;
9191 L4_MABX_B.JerkVectorRaw[0] = L4_MABX_DW.Jerk12;
9192 L4_MABX_B.JerkVectorRaw[1] = L4_MABX_DW.Jerk12;
9193 L4_MABX_B.JerkVectorRaw[2] = 0.0;
9194 L4_MABX_B.JerkVectorRaw[3] = 0.0;
9195 L4_MABX_B.JerkVectorRaw[4] = L4_MABX_DW.Jerk56;
9196 L4_MABX_B.JerkVectorRaw[5] = L4_MABX_DW.Jerk56;
9197 L4_MABX_B.AccelerationVectorRaw[0] =
9198 L4_MABX_DW.AccelerationInitialLimited;
9199 }
9200 }
9201
9202 /* Transition: '<S359>:29' */
9203 L4_MABX_B.VelocityVectorRaw[0] = L4_MABX_DW.VelocityInitialLimited;
9204 L4_MABX_B.PositionVectorRaw[0] = 0.0;
9205 for (j = 2U; j < 7; j++) {
9206 /* Transition: '<S359>:34' */
9207 /* Transition: '<S359>:36' */
9208 DeltaTime = L4_MABX_B.TimeVectorRaw[j - 1] - L4_MABX_B.TimeVectorRaw[j -
9209 2];
9210 L4_MABX_B.AccelerationVectorRaw[j - 1] = L4_MABX_B.JerkVectorRaw[j - 2] *
9211 DeltaTime + L4_MABX_B.AccelerationVectorRaw[j - 2];
9212 L4_MABX_B.VelocityVectorRaw[j - 1] = (L4_MABX_B.AccelerationVectorRaw[j
9213 - 2] * DeltaTime + L4_MABX_B.VelocityVectorRaw[j - 2]) +
9214 L4_MABX_B.JerkVectorRaw[j - 2] * 0.5 * (DeltaTime * DeltaTime);
9215 L4_MABX_B.PositionVectorRaw[j - 1] = ((L4_MABX_B.VelocityVectorRaw[j - 2]
9216 * DeltaTime + L4_MABX_B.PositionVectorRaw[j - 2]) +
9217 L4_MABX_B.AccelerationVectorRaw[j - 2] * 0.5 * (DeltaTime * DeltaTime))
9218 + L4_MABX_B.JerkVectorRaw[j - 2] / 6.0 * rt_powd_snf(DeltaTime, 3.0);
9219
9220 /* Transition: '<S359>:33' */
9221 }
9222
9223 /* Transition: '<S359>:37' */
9224 DeltaTimeFinal *= 0.5;
9225 if ((L4_MABX_B.PositionVectorRaw[5] - PositionFinalLimited < 0.0) &&
9226 (L4_MABX_B.VelocityVectorRaw[5] > 0.0)) {
9227 /* Transition: '<S359>:61' */
9228 /* Transition: '<S359>:62' */
9229 L4_MABX_DW.TimeFinal += DeltaTimeFinal;
9230
9231 /* Transition: '<S359>:64' */
9232 } else {
9233 /* Transition: '<S359>:63' */
9234 L4_MABX_DW.TimeFinal -= DeltaTimeFinal;
9235 }
9236
9237 /* Transition: '<S359>:60' */
9238 Time56 = L4_MABX_DW.TimeFinal;
9239 if ((0.007 > Time56) || rtIsNaN(Time56)) {
9240 L4_MABX_DW.TimeFinal = 0.007;
9241 } else {
9242 L4_MABX_DW.TimeFinal = Time56;
9243 }
9244
9245 /* Transition: '<S359>:17' */
9246 }
9247
9248 /* Transition: '<S359>:18' */
9249 /* Transition: '<S359>:91' */
9250 } else {
9251 /* Transition: '<S359>:90' */
9252 }
9253
9254 /* End of Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */
9255
9256 /* Chart: '<S344>/TwentyPointVectorCalculation' */
9257 if (L4_MABX_B.LogicalOperator1_ja) {
9258 /* Transition: '<S358>:89' */
9259 /* Transition: '<S358>:39' */
9260 L4_MABX_B.TimeVector[0] = L4_MABX_B.TimeVectorRaw[0];
9261 L4_MABX_B.JerkVector[0] = L4_MABX_B.JerkVectorRaw[0];
9262 L4_MABX_B.AccelerationVector[0] = L4_MABX_B.AccelerationVectorRaw[0];
9263 L4_MABX_B.VelocityVector[0] = L4_MABX_B.VelocityVectorRaw[0];
9264 L4_MABX_B.PositionVector[0] = L4_MABX_B.PositionVectorRaw[0];
9265 PositionFinalLimited = (L4_MABX_B.TimeVectorRaw[1] -
9266 L4_MABX_B.TimeVectorRaw[0]) / 10.0;
9267 for (starting_index = 2U; starting_index < 11; starting_index++) {
9268 /* Transition: '<S358>:14' */
9269 /* Transition: '<S358>:101' */
9270 L4_MABX_B.TimeVector[starting_index - 1] =
9271 L4_MABX_B.TimeVector[starting_index - 2] + PositionFinalLimited;
9272 DeltaTime = L4_MABX_B.TimeVector[starting_index - 1] -
9273 L4_MABX_B.TimeVectorRaw[0];
9274 L4_MABX_B.JerkVector[starting_index - 1] = L4_MABX_B.JerkVectorRaw[0];
9275 L4_MABX_B.AccelerationVector[starting_index - 1] =
9276 L4_MABX_B.JerkVectorRaw[0] * DeltaTime +
9277 L4_MABX_B.AccelerationVectorRaw[0];
9278 L4_MABX_B.VelocityVector[starting_index - 1] =
9279 (L4_MABX_B.AccelerationVectorRaw[0] * DeltaTime +
9280 L4_MABX_B.VelocityVectorRaw[0]) + 0.5 * L4_MABX_B.JerkVectorRaw[0] *
9281 (DeltaTime * DeltaTime);
9282 L4_MABX_B.PositionVector[starting_index - 1] =
9283 ((L4_MABX_B.VelocityVectorRaw[0] * DeltaTime +
9284 L4_MABX_B.PositionVectorRaw[0]) + 0.5 *
9285 L4_MABX_B.AccelerationVectorRaw[0] * (DeltaTime * DeltaTime)) +
9286 L4_MABX_B.JerkVectorRaw[0] / 6.0 * rt_powd_snf(DeltaTime, 3.0);
9287 DeltaTime = L4_MABX_B.PositionVector[starting_index - 2] + 0.0001;
9288 Time56 = L4_MABX_B.PositionVector[starting_index - 1];
9289 if ((DeltaTime > Time56) || rtIsNaN(Time56)) {
9290 Time56 = DeltaTime;
9291 }
9292
9293 L4_MABX_B.PositionVector[starting_index - 1] = Time56;
9294
9295 /* Transition: '<S358>:17' */
9296 }
9297
9298 /* Transition: '<S358>:110' */
9299 L4_MABX_B.TimeVector[10] = L4_MABX_B.TimeVectorRaw[1];
9300 L4_MABX_B.JerkVector[10] = L4_MABX_B.JerkVectorRaw[1];
9301 L4_MABX_B.AccelerationVector[10] = L4_MABX_B.AccelerationVectorRaw[1];
9302 L4_MABX_B.VelocityVector[10] = L4_MABX_B.VelocityVectorRaw[1];
9303 DeltaTime = L4_MABX_B.PositionVector[9] + 0.0001;
9304 Time56 = L4_MABX_B.PositionVectorRaw[1];
9305 if ((DeltaTime > Time56) || rtIsNaN(Time56)) {
9306 Time56 = DeltaTime;
9307 }
9308
9309 L4_MABX_B.PositionVector[10] = Time56;
9310 L4_MABX_B.TimeVector[11] = L4_MABX_B.TimeVectorRaw[2];
9311 L4_MABX_B.JerkVector[11] = L4_MABX_B.JerkVectorRaw[2];
9312 L4_MABX_B.AccelerationVector[11] = L4_MABX_B.AccelerationVectorRaw[2];
9313 L4_MABX_B.VelocityVector[11] = L4_MABX_B.VelocityVectorRaw[2];
9314 DeltaTime = L4_MABX_B.PositionVector[10] + 0.0001;
9315 Time56 = L4_MABX_B.PositionVectorRaw[2];
9316 if ((DeltaTime > Time56) || rtIsNaN(Time56)) {
9317 Time56 = DeltaTime;
9318 }
9319
9320 L4_MABX_B.PositionVector[11] = Time56;
9321 PositionFinalLimited = (L4_MABX_B.TimeVectorRaw[3] -
9322 L4_MABX_B.TimeVectorRaw[2]) / 10.0;
9323 for (starting_index = 13U; starting_index < 22; starting_index++) {
9324 /* Transition: '<S358>:127' */
9325 /* Transition: '<S358>:133' */
9326 L4_MABX_B.TimeVector[starting_index - 1] =
9327 L4_MABX_B.TimeVector[starting_index - 2] + PositionFinalLimited;
9328 DeltaTime = L4_MABX_B.TimeVector[starting_index - 1] -
9329 L4_MABX_B.TimeVectorRaw[2];
9330 L4_MABX_B.JerkVector[starting_index - 1] = L4_MABX_B.JerkVectorRaw[2];
9331 L4_MABX_B.AccelerationVector[starting_index - 1] =
9332 L4_MABX_B.JerkVectorRaw[2] * DeltaTime +
9333 L4_MABX_B.AccelerationVectorRaw[2];
9334 L4_MABX_B.VelocityVector[starting_index - 1] =
9335 (L4_MABX_B.AccelerationVectorRaw[2] * DeltaTime +
9336 L4_MABX_B.VelocityVectorRaw[2]) + 0.5 * L4_MABX_B.JerkVectorRaw[2] *
9337 (DeltaTime * DeltaTime);
9338 L4_MABX_B.PositionVector[starting_index - 1] =
9339 ((L4_MABX_B.VelocityVectorRaw[2] * DeltaTime +
9340 L4_MABX_B.PositionVectorRaw[2]) + 0.5 *
9341 L4_MABX_B.AccelerationVectorRaw[2] * (DeltaTime * DeltaTime)) +
9342 L4_MABX_B.JerkVectorRaw[2] / 6.0 * rt_powd_snf(DeltaTime, 3.0);
9343 DeltaTime = L4_MABX_B.PositionVector[starting_index - 2] + 0.0001;
9344 Time56 = L4_MABX_B.PositionVector[starting_index - 1];
9345 if ((DeltaTime > Time56) || rtIsNaN(Time56)) {
9346 Time56 = DeltaTime;
9347 }
9348
9349 L4_MABX_B.PositionVector[starting_index - 1] = Time56;
9350
9351 /* Transition: '<S358>:131' */
9352 }
9353
9354 /* Transition: '<S358>:132' */
9355 L4_MABX_B.TimeVector[21] = L4_MABX_B.TimeVectorRaw[3];
9356 L4_MABX_B.JerkVector[21] = L4_MABX_B.JerkVectorRaw[3];
9357 L4_MABX_B.AccelerationVector[21] = L4_MABX_B.AccelerationVectorRaw[3];
9358 L4_MABX_B.VelocityVector[21] = L4_MABX_B.VelocityVectorRaw[3];
9359 DeltaTime = L4_MABX_B.PositionVector[20] + 0.0001;
9360 Time56 = L4_MABX_B.PositionVectorRaw[3];
9361 if ((DeltaTime > Time56) || rtIsNaN(Time56)) {
9362 Time56 = DeltaTime;
9363 }
9364
9365 L4_MABX_B.PositionVector[21] = Time56;
9366 L4_MABX_B.TimeVector[22] = L4_MABX_B.TimeVectorRaw[4];
9367 L4_MABX_B.JerkVector[22] = L4_MABX_B.JerkVectorRaw[4];
9368 L4_MABX_B.AccelerationVector[22] = L4_MABX_B.AccelerationVectorRaw[4];
9369 L4_MABX_B.VelocityVector[22] = L4_MABX_B.VelocityVectorRaw[4];
9370 DeltaTime = L4_MABX_B.PositionVector[21] + 0.0001;
9371 Time56 = L4_MABX_B.PositionVectorRaw[4];
9372 if ((DeltaTime > Time56) || rtIsNaN(Time56)) {
9373 Time56 = DeltaTime;
9374 }
9375
9376 L4_MABX_B.PositionVector[22] = Time56;
9377 PositionFinalLimited = (L4_MABX_B.TimeVectorRaw[5] -
9378 L4_MABX_B.TimeVectorRaw[4]) / 10.0;
9379 for (starting_index = 24U; starting_index < 33; starting_index++) {
9380 /* Transition: '<S358>:111' */
9381 /* Transition: '<S358>:113' */
9382 L4_MABX_B.TimeVector[starting_index - 1] =
9383 L4_MABX_B.TimeVector[starting_index - 2] + PositionFinalLimited;
9384 DeltaTime = L4_MABX_B.TimeVector[starting_index - 1] -
9385 L4_MABX_B.TimeVectorRaw[4];
9386 L4_MABX_B.JerkVector[starting_index - 1] = L4_MABX_B.JerkVectorRaw[4];
9387 L4_MABX_B.AccelerationVector[starting_index - 1] =
9388 L4_MABX_B.JerkVectorRaw[4] * DeltaTime +
9389 L4_MABX_B.AccelerationVectorRaw[4];
9390 L4_MABX_B.VelocityVector[starting_index - 1] =
9391 (L4_MABX_B.AccelerationVectorRaw[4] * DeltaTime +
9392 L4_MABX_B.VelocityVectorRaw[4]) + 0.5 * L4_MABX_B.JerkVectorRaw[4] *
9393 (DeltaTime * DeltaTime);
9394 L4_MABX_B.PositionVector[starting_index - 1] =
9395 ((L4_MABX_B.VelocityVectorRaw[4] * DeltaTime +
9396 L4_MABX_B.PositionVectorRaw[4]) + 0.5 *
9397 L4_MABX_B.AccelerationVectorRaw[4] * (DeltaTime * DeltaTime)) +
9398 L4_MABX_B.JerkVectorRaw[4] / 6.0 * rt_powd_snf(DeltaTime, 3.0);
9399 DeltaTime = L4_MABX_B.PositionVector[starting_index - 2] + 0.0001;
9400 Time56 = L4_MABX_B.PositionVector[starting_index - 1];
9401 if ((DeltaTime > Time56) || rtIsNaN(Time56)) {
9402 Time56 = DeltaTime;
9403 }
9404
9405 L4_MABX_B.PositionVector[starting_index - 1] = Time56;
9406
9407 /* Transition: '<S358>:112' */
9408 }
9409
9410 /* Transition: '<S358>:114' */
9411 L4_MABX_B.TimeVector[32] = L4_MABX_B.TimeVectorRaw[5];
9412 L4_MABX_B.JerkVector[32] = L4_MABX_B.JerkVectorRaw[5];
9413 L4_MABX_B.AccelerationVector[32] = L4_MABX_B.AccelerationVectorRaw[5];
9414 L4_MABX_B.VelocityVector[32] = L4_MABX_B.VelocityVectorRaw[5];
9415 DeltaTime = L4_MABX_B.PositionVector[31] + 0.0001;
9416 Time56 = L4_MABX_B.PositionVectorRaw[5];
9417 if ((DeltaTime > Time56) || rtIsNaN(Time56)) {
9418 Time56 = DeltaTime;
9419 }
9420
9421 L4_MABX_B.PositionVector[32] = Time56;
9422
9423 /* Transition: '<S358>:141' */
9424 } else {
9425 /* Transition: '<S358>:90' */
9426 }
9427
9428 /* End of Chart: '<S344>/TwentyPointVectorCalculation' */
9429
9430 /* Gain: '<S344>/Gain3' */
9431 /* Transition: '<S359>:93' */
9432 /* Gateway: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/TwentyPointVectorCalculation */
9433 /* During: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/TwentyPointVectorCalculation */
9434 /* Entry Internal: L4_Controller/Task_10ms/Vehicle_speed_target/Determine_sigmoid_vehicle_speed_profile/TwentyPointVectorCalculation */
9435 /* Transition: '<S358>:88' */
9436 /* Transition: '<S358>:93' */
9437 for (i = 0; i < 33; i++) {
9438 L4_MABX_B.Vehicle_speed_vector_kph[i] = L4_MABX_P.Gain3_Gain_l *
9439 L4_MABX_B.VelocityVector[i];
9440 }
9441
9442 /* End of Gain: '<S344>/Gain3' */
9443
9444 /* RelationalOperator: '<S361>/Compare' incorporates:
9445 * Constant: '<S361>/Constant'
9446 */
9447 for (i = 0; i < 33; i++) {
9448 L4_MABX_B.Compare_nk[i] = (L4_MABX_B.Vehicle_speed_vector_kph[i] <
9449 L4_MABX_P.Constant_Value_n);
9450 }
9451
9452 /* End of RelationalOperator: '<S361>/Compare' */
9453
9454 /* Logic: '<S356>/Logical Operator' */
9455 zcEvent = L4_MABX_B.Compare_nk[0];
9456 for (i = 0; i < 32; i++) {
9457 zcEvent = (zcEvent || L4_MABX_B.Compare_nk[i + 1]);
9458 }
9459
9460 L4_MABX_B.f_vspd_output_less_than_zero = zcEvent;
9461
9462 /* End of Logic: '<S356>/Logical Operator' */
9463
9464 /* MinMax: '<S356>/MinMax3' */
9465 PositionFinalLimited = L4_MABX_B.Vehicle_speed_vector_kph[0];
9466 for (i = 0; i < 32; i++) {
9467 Time56 = L4_MABX_B.Vehicle_speed_vector_kph[i + 1];
9468 if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) {
9469 PositionFinalLimited = Time56;
9470 }
9471 }
9472
9473 L4_MABX_B.MinMax3 = PositionFinalLimited;
9474
9475 /* End of MinMax: '<S356>/MinMax3' */
9476
9477 /* UnitDelay: '<S360>/Unit_Delay' */
9478 L4_MABX_B.Unit_Delay_f = L4_MABX_DW.Unit_Delay_DSTATE_bw;
9479
9480 /* Outputs for Atomic SubSystem: '<S360>/If_Then_Else' */
9481 L4_MABX_If_Then_Else_g(L4_MABX_B.LogicalOperator1_ja, L4_MABX_B.Saturation5,
9482 L4_MABX_B.Unit_Delay_f, &L4_MABX_B.If_Then_Else_og);
9483
9484 /* End of Outputs for SubSystem: '<S360>/If_Then_Else' */
9485
9486 /* MinMax: '<S356>/MinMax5' */
9487 DeltaTime = L4_MABX_B.If_Then_Else_og.Switch;
9488 PositionFinalLimited = L4_MABX_B.VSPD_TARGET_KPH_APV_gu;
9489 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
9490 PositionFinalLimited = DeltaTime;
9491 }
9492
9493 L4_MABX_B.MinMax5 = PositionFinalLimited;
9494
9495 /* End of MinMax: '<S356>/MinMax5' */
9496
9497 /* Sum: '<S356>/Subtract' */
9498 L4_MABX_B.Subtract_al = L4_MABX_B.MinMax3 - L4_MABX_B.MinMax5;
9499
9500 /* Abs: '<S356>/Abs' */
9501 L4_MABX_B.Abs_m = fabs(L4_MABX_B.Subtract_al);
9502
9503 /* RelationalOperator: '<S356>/Relational Operator' incorporates:
9504 * Constant: '<S356>/MIN_VSPD_DELTA_THRESHOLD_KPH_APV'
9505 */
9506 L4_MABX_B.RelationalOperator_f = (L4_MABX_B.Abs_m >
9507 L4_MABX_P.MIN_VSPD_DELTA_THRESHOLD_KPH_AP);
9508
9509 /* Logic: '<S362>/Logical Operator3' incorporates:
9510 * Constant: '<S356>/CPV'
9511 */
9512 L4_MABX_B.LogicalOperator3_o = !L4_MABX_P.CPV_Value_a;
9513
9514 /* UnitDelay: '<S362>/Unit_Delay' */
9515 L4_MABX_B.Unit_Delay_ag = L4_MABX_DW.Unit_Delay_DSTATE_ko;
9516
9517 /* Logic: '<S362>/Logical Operator' */
9518 L4_MABX_B.LogicalOperator_o = (L4_MABX_B.LogicalOperator3_o &&
9519 L4_MABX_B.Unit_Delay_ag);
9520
9521 /* Logic: '<S362>/Logical Operator1' */
9522 L4_MABX_B.LogicalOperator1_p = (L4_MABX_B.LogicalOperator1_ja ||
9523 L4_MABX_B.LogicalOperator_o);
9524
9525 /* Logic: '<S356>/Logical Operator2' */
9526 L4_MABX_B.f_vspd_min_delta_greater_than_t = (L4_MABX_B.RelationalOperator_f &&
9527 L4_MABX_B.LogicalOperator1_p);
9528
9529 /* MinMax: '<S356>/MinMax4' */
9530 PositionFinalLimited = L4_MABX_B.Vehicle_speed_vector_kph[0];
9531 for (i = 0; i < 32; i++) {
9532 Time56 = L4_MABX_B.Vehicle_speed_vector_kph[i + 1];
9533 if (!((PositionFinalLimited > Time56) || rtIsNaN(Time56))) {
9534 PositionFinalLimited = Time56;
9535 }
9536 }
9537
9538 L4_MABX_B.MinMax4 = PositionFinalLimited;
9539
9540 /* End of MinMax: '<S356>/MinMax4' */
9541
9542 /* MinMax: '<S356>/MinMax6' */
9543 DeltaTime = L4_MABX_B.If_Then_Else_og.Switch;
9544 PositionFinalLimited = L4_MABX_B.VSPD_TARGET_KPH_APV_gu;
9545 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
9546 PositionFinalLimited = DeltaTime;
9547 }
9548
9549 L4_MABX_B.MinMax6_j = PositionFinalLimited;
9550
9551 /* End of MinMax: '<S356>/MinMax6' */
9552
9553 /* Sum: '<S356>/Subtract1' */
9554 L4_MABX_B.Subtract1_c = L4_MABX_B.MinMax4 - L4_MABX_B.MinMax6_j;
9555
9556 /* Abs: '<S356>/Abs1' */
9557 L4_MABX_B.Abs1_h5 = fabs(L4_MABX_B.Subtract1_c);
9558
9559 /* RelationalOperator: '<S356>/Relational Operator1' incorporates:
9560 * Constant: '<S356>/MAX_VSPD_DELTA_THRESHOLD_KPH_APV'
9561 */
9562 L4_MABX_B.RelationalOperator1_g4 = (L4_MABX_B.Abs1_h5 >
9563 L4_MABX_P.MAX_VSPD_DELTA_THRESHOLD_KPH_AP);
9564
9565 /* Logic: '<S356>/Logical Operator1' */
9566 L4_MABX_B.f_vspd_max_delta_greater_than_t = (L4_MABX_B.RelationalOperator1_g4 &&
9567 L4_MABX_B.LogicalOperator1_p);
9568
9569 /* MinMax: '<S356>/MinMax8' */
9570 PositionFinalLimited = L4_MABX_B.AccelerationVector[0];
9571 for (i = 0; i < 32; i++) {
9572 Time56 = L4_MABX_B.AccelerationVector[i + 1];
9573 if (!((PositionFinalLimited > Time56) || rtIsNaN(Time56))) {
9574 PositionFinalLimited = Time56;
9575 }
9576 }
9577
9578 L4_MABX_B.MinMax8 = PositionFinalLimited;
9579
9580 /* End of MinMax: '<S356>/MinMax8' */
9581
9582 /* RelationalOperator: '<S356>/Relational Operator2' incorporates:
9583 * Constant: '<S356>/ACCEL_RATE_ABS_MAX_THRESHOLD_MS2_APV'
9584 */
9585 L4_MABX_B.f_accel_rate_greater_than_thres = (L4_MABX_B.MinMax8 >
9586 L4_MABX_P.ACCEL_RATE_ABS_MAX_THRESHOLD_MS);
9587
9588 /* MinMax: '<S356>/MinMax7' */
9589 PositionFinalLimited = L4_MABX_B.AccelerationVector[0];
9590 for (i = 0; i < 32; i++) {
9591 Time56 = L4_MABX_B.AccelerationVector[i + 1];
9592 if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) {
9593 PositionFinalLimited = Time56;
9594 }
9595 }
9596
9597 L4_MABX_B.MinMax7 = PositionFinalLimited;
9598
9599 /* End of MinMax: '<S356>/MinMax7' */
9600
9601 /* RelationalOperator: '<S356>/Relational Operator3' incorporates:
9602 * Constant: '<S356>/ACCEL_RATE_ABS_MIN_THRESHOLD_MS2_APV'
9603 */
9604 L4_MABX_B.f_decel_rate_greater_than_thres = (L4_MABX_B.MinMax7 <
9605 L4_MABX_P.ACCEL_RATE_ABS_MIN_THRESHOLD_MS);
9606
9607 /* MinMax: '<S356>/MinMax10' */
9608 PositionFinalLimited = L4_MABX_B.JerkVector[0];
9609 for (i = 0; i < 32; i++) {
9610 Time56 = L4_MABX_B.JerkVector[i + 1];
9611 if (!((PositionFinalLimited > Time56) || rtIsNaN(Time56))) {
9612 PositionFinalLimited = Time56;
9613 }
9614 }
9615
9616 L4_MABX_B.MinMax10 = PositionFinalLimited;
9617
9618 /* End of MinMax: '<S356>/MinMax10' */
9619
9620 /* RelationalOperator: '<S356>/Relational Operator4' incorporates:
9621 * Constant: '<S356>/JERK_RATE_ABS_MAX_THRESHOLD_MS3_APV'
9622 */
9623 L4_MABX_B.f_jerk_rate_greater_than_thresh = (L4_MABX_B.MinMax10 >
9624 L4_MABX_P.JERK_RATE_ABS_MAX_THRESHOLD_MS3);
9625
9626 /* MinMax: '<S356>/MinMax9' */
9627 PositionFinalLimited = L4_MABX_B.JerkVector[0];
9628 for (i = 0; i < 32; i++) {
9629 Time56 = L4_MABX_B.JerkVector[i + 1];
9630 if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) {
9631 PositionFinalLimited = Time56;
9632 }
9633 }
9634
9635 L4_MABX_B.MinMax9 = PositionFinalLimited;
9636
9637 /* End of MinMax: '<S356>/MinMax9' */
9638
9639 /* RelationalOperator: '<S356>/Relational Operator5' incorporates:
9640 * Constant: '<S356>/JERK_RATE_ABS_MIN_THRESHOLD_MS3_APV'
9641 */
9642 L4_MABX_B.f_jerk_rate_greater_than_thre_n = (L4_MABX_B.MinMax9 <
9643 L4_MABX_P.JERK_RATE_ABS_MIN_THRESHOLD_MS3);
9644
9645 /* Sum: '<S356>/Subtract2' */
9646 L4_MABX_B.Subtract2 = L4_MABX_B.Distance_to_achieve_speed_targe -
9647 L4_MABX_B.PositionVector[32];
9648
9649 /* Abs: '<S356>/Abs2' */
9650 L4_MABX_B.Abs2 = fabs(L4_MABX_B.Subtract2);
9651
9652 /* RelationalOperator: '<S356>/Relational Operator6' incorporates:
9653 * Constant: '<S356>/MAX_DISTANCE_DELTA_THRESHOLD_M_APV'
9654 */
9655 L4_MABX_B.RelationalOperator6_i = (L4_MABX_B.Abs2 >
9656 L4_MABX_P.MAX_DISTANCE_DELTA_THRESHOLD_M_);
9657
9658 /* Logic: '<S356>/Logical Operator3' */
9659 L4_MABX_B.f_distance_max_delta_greater_th = (L4_MABX_B.RelationalOperator6_i &&
9660 L4_MABX_B.LogicalOperator1_p);
9661
9662 /* Logic: '<S356>/Logical Operator4' */
9663 L4_MABX_B.F_Inhibit_sigmoid_vector_shapin =
9664 (L4_MABX_B.f_vspd_output_less_than_zero ||
9665 L4_MABX_B.f_vspd_min_delta_greater_than_t ||
9666 L4_MABX_B.f_vspd_max_delta_greater_than_t ||
9667 L4_MABX_B.f_accel_rate_greater_than_thres ||
9668 L4_MABX_B.f_decel_rate_greater_than_thres ||
9669 L4_MABX_B.f_jerk_rate_greater_than_thresh ||
9670 L4_MABX_B.f_jerk_rate_greater_than_thre_n ||
9671 L4_MABX_B.f_distance_max_delta_greater_th);
9672
9673 /* Logic: '<S81>/Logical Operator' */
9674 L4_MABX_B.LogicalOperator_nd = !L4_MABX_B.F_Inhibit_sigmoid_vector_shapin;
9675
9676 /* Logic: '<S81>/Logical Operator2' */
9677 L4_MABX_B.LogicalOperator2_ft = (L4_MABX_B.Compare_jr &&
9678 L4_MABX_B.LogicalOperator_nd);
9679
9680 /* RelationalOperator: '<S357>/Relational Operator3' incorporates:
9681 * Constant: '<S357>/CPV1'
9682 */
9683 L4_MABX_B.RelationalOperator3_k = (L4_MABX_B.Saturation5 <
9684 L4_MABX_P.CPV1_Value_i);
9685
9686 /* RelationalOperator: '<S357>/Relational Operator1' incorporates:
9687 * Constant: '<S344>/MIN_VSPD_SIGMOID_INITIAL_KPH_APV'
9688 */
9689 L4_MABX_B.RelationalOperator1_hj = (L4_MABX_B.If_Then_Else_og.Switch <
9690 L4_MABX_P.MIN_VSPD_SIGMOID_INITIAL_KPH_AP);
9691
9692 /* Logic: '<S357>/Logical Operator' */
9693 L4_MABX_B.LogicalOperator_da = (L4_MABX_B.RelationalOperator3_k ||
9694 L4_MABX_B.RelationalOperator1_hj);
9695
9696 /* RelationalOperator: '<S357>/Relational Operator2' incorporates:
9697 * Constant: '<S344>/MIN_VSPD_SIGMOID_FINAL_KPH_APV'
9698 */
9699 L4_MABX_B.RelationalOperator2_g = (L4_MABX_B.VSPD_TARGET_KPH_APV_gu <
9700 L4_MABX_P.MIN_VSPD_SIGMOID_FINAL_KPH_APV_);
9701
9702 /* Logic: '<S357>/Logical Operator2' */
9703 L4_MABX_B.F_set_max_distance_accumulated = (L4_MABX_B.LogicalOperator_da &&
9704 L4_MABX_B.RelationalOperator2_g);
9705
9706 /* UnitDelay: '<S371>/FixPt Unit Delay2' */
9707 L4_MABX_B.FixPtUnitDelay2_oi = L4_MABX_DW.FixPtUnitDelay2_DSTATE_fh;
9708
9709 /* Logic: '<S371>/FixPt Logical Operator' */
9710 L4_MABX_B.FixPtLogicalOperator = (uint8_T)(L4_MABX_B.LogicalOperator1_ja ||
9711 (L4_MABX_B.FixPtUnitDelay2_oi != 0));
9712
9713 /* UnitDelay: '<S371>/FixPt Unit Delay1' */
9714 L4_MABX_B.Xold_p = L4_MABX_DW.FixPtUnitDelay1_DSTATE_l;
9715
9716 /* Switch: '<S371>/Init' incorporates:
9717 * Constant: '<S366>/CPV'
9718 */
9719 if (L4_MABX_B.FixPtLogicalOperator != 0) {
9720 L4_MABX_B.Init_hz = L4_MABX_P.CPV_Value_h;
9721 } else {
9722 L4_MABX_B.Init_hz = L4_MABX_B.Xold_p;
9723 }
9724
9725 /* End of Switch: '<S371>/Init' */
9726
9727 /* Gain: '<S357>/Gain1' */
9728 L4_MABX_B.Gain1_c = L4_MABX_P.Gain1_Gain_k * L4_MABX_B.Saturation5;
9729
9730 /* DigitalClock: '<S369>/Digital Clock' */
9731 L4_MABX_B.DigitalClock_f = L4_MABX_M->Timing.t[0];
9732
9733 /* UnitDelay: '<S369>/Unit_Delay' */
9734 L4_MABX_B.Unit_Delay_e = L4_MABX_DW.Unit_Delay_DSTATE_p;
9735
9736 /* Sum: '<S369>/Subtract' */
9737 L4_MABX_B.Subtract_b = L4_MABX_B.DigitalClock_f - L4_MABX_B.Unit_Delay_e;
9738
9739 /* Product: '<S366>/Product1' incorporates:
9740 * Constant: '<S365>/CPV1'
9741 */
9742 L4_MABX_B.Product1_a = L4_MABX_P.CPV1_Value_e * L4_MABX_B.Gain1_c *
9743 L4_MABX_B.Subtract_b;
9744
9745 /* Sum: '<S366>/Add' */
9746 L4_MABX_B.Add_h = L4_MABX_B.Init_hz + L4_MABX_B.Product1_a;
9747
9748 /* MinMax: '<S366>/MinMax' */
9749 DeltaTime = L4_MABX_B.Distance_to_achieve_speed_targe;
9750 PositionFinalLimited = L4_MABX_B.Add_h;
9751 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
9752 PositionFinalLimited = DeltaTime;
9753 }
9754
9755 L4_MABX_B.MinMax_a = PositionFinalLimited;
9756
9757 /* End of MinMax: '<S366>/MinMax' */
9758
9759 /* Outputs for Atomic SubSystem: '<S366>/If_Then_Else' */
9760 L4_MABX_If_Then_Else_g(L4_MABX_B.F_set_max_distance_accumulated,
9761 L4_MABX_B.Distance_to_achieve_speed_targe, L4_MABX_B.MinMax_a,
9762 &L4_MABX_B.If_Then_Else_gf);
9763
9764 /* End of Outputs for SubSystem: '<S366>/If_Then_Else' */
9765
9766 /* RelationalOperator: '<S357>/Relational Operator' */
9767 L4_MABX_B.RelationalOperator_l = (L4_MABX_B.If_Then_Else_gf.Switch ==
9768 L4_MABX_B.Distance_to_achieve_speed_targe);
9769
9770 /* S-Function (sfix_look1_dyn): '<S357>/Lookup Table Dynamic' */
9771 /* Dynamic Look-Up Table Block: '<S357>/Lookup Table Dynamic'
9772 * Input0 Data Type: Floating Point real_T
9773 * Input1 Data Type: Floating Point real_T
9774 * Input2 Data Type: Floating Point real_T
9775 * Output0 Data Type: Floating Point real_T
9776 * Lookup Method: Linear_Endpoint
9777 *
9778 */
9779 LookUp_real_T_real_T( &(L4_MABX_B.LookupTableDynamic),
9780 &L4_MABX_B.Vehicle_speed_vector_kph[0],
9781 L4_MABX_B.If_Then_Else_gf.Switch,
9782 &L4_MABX_B.PositionVector[0], 32U);
9783
9784 /* Outputs for Atomic SubSystem: '<S357>/If_Then_Else' */
9785 L4_MABX_If_Then_Else_g(L4_MABX_B.RelationalOperator_l,
9786 L4_MABX_B.VSPD_TARGET_KPH_APV_gu, L4_MABX_B.LookupTableDynamic,
9787 &L4_MABX_B.If_Then_Else_j);
9788
9789 /* End of Outputs for SubSystem: '<S357>/If_Then_Else' */
9790
9791 /* UnitDelay: '<S349>/Delay Input1' */
9792 L4_MABX_B.Uk1_k[0] = L4_MABX_DW.DelayInput1_DSTATE_f[0];
9793 L4_MABX_B.Uk1_k[1] = L4_MABX_DW.DelayInput1_DSTATE_f[1];
9794
9795 /* RelationalOperator: '<S349>/FixPt Relational Operator' */
9796 L4_MABX_B.FixPtRelationalOperator_p[0] =
9797 (L4_MABX_B.Distance_to_achieve_speed_targe != L4_MABX_B.Uk1_k[0]);
9798 L4_MABX_B.FixPtRelationalOperator_p[1] = (L4_MABX_B.Vehicle_speed_target_o !=
9799 L4_MABX_B.Uk1_k[1]);
9800
9801 /* Logic: '<S343>/Logical Operator' */
9802 L4_MABX_B.LogicalOperator_g = (L4_MABX_B.FixPtRelationalOperator_p[0] ||
9803 L4_MABX_B.FixPtRelationalOperator_p[1]);
9804
9805 /* UnitDelay: '<S351>/Unit_Delay' */
9806 L4_MABX_B.Unit_Delay_ls = L4_MABX_DW.Unit_Delay_DSTATE_la;
9807
9808 /* Logic: '<S351>/Logical Operator1' */
9809 L4_MABX_B.LogicalOperator1_lp = (L4_MABX_B.LogicalOperator_g ||
9810 L4_MABX_B.Unit_Delay_ls);
9811
9812 /* UnitDelay: '<S355>/FixPt Unit Delay2' */
9813 L4_MABX_B.FixPtUnitDelay2_n = L4_MABX_DW.FixPtUnitDelay2_DSTATE_c;
9814
9815 /* UnitDelay: '<S355>/FixPt Unit Delay1' */
9816 L4_MABX_B.Xold_o = L4_MABX_DW.FixPtUnitDelay1_DSTATE_ej;
9817
9818 /* Switch: '<S355>/Init' */
9819 if (L4_MABX_B.FixPtUnitDelay2_n != 0) {
9820 L4_MABX_B.Init_p = L4_MABX_B.Vehicle_speed_target_o;
9821 } else {
9822 L4_MABX_B.Init_p = L4_MABX_B.Xold_o;
9823 }
9824
9825 /* End of Switch: '<S355>/Init' */
9826
9827 /* UnitDelay: '<S350>/Unit_Delay' */
9828 L4_MABX_B.Vehicle_speed_target_c = L4_MABX_DW.Unit_Delay_1_DSTATE_j;
9829 L4_MABX_B.Vehicle_speed = L4_MABX_DW.Unit_Delay_2_DSTATE_e;
9830 L4_MABX_B.Distance_m = L4_MABX_DW.Unit_Delay_3_DSTATE_j;
9831
9832 /* Outputs for Atomic SubSystem: '<S350>/If_Then_Else' */
9833 L4_MABX_If_Then_Else_m(L4_MABX_B.LogicalOperator_g,
9834 L4_MABX_B.Vehicle_speed_target_o, L4_MABX_B.SFunction1_o1_ie,
9835 L4_MABX_B.Distance_to_achieve_speed_targe, L4_MABX_B.Vehicle_speed_target_c,
9836 L4_MABX_B.Vehicle_speed, L4_MABX_B.Distance_m, &L4_MABX_B.If_Then_Else_mm);
9837
9838 /* End of Outputs for SubSystem: '<S350>/If_Then_Else' */
9839
9840 /* Sum: '<S350>/Subtract' */
9841 L4_MABX_B.err = L4_MABX_B.If_Then_Else_mm.Vehicle_speed -
9842 L4_MABX_B.If_Then_Else_mm.Vehicle_speed_target;
9843
9844 /* Abs: '<S350>/Abs2' */
9845 L4_MABX_B.err_abs = fabs(L4_MABX_B.err);
9846
9847 /* Gain: '<S350>/Gain2' */
9848 L4_MABX_B.Gain2_k = L4_MABX_P.Gain2_Gain_l *
9849 L4_MABX_B.If_Then_Else_mm.Vehicle_speed;
9850
9851 /* Saturate: '<S350>/Saturation4' */
9852 DeltaTime = L4_MABX_B.Gain2_k;
9853 Time56 = L4_MABX_P.Saturation4_LowerSat_e;
9854 PositionFinalLimited = L4_MABX_P.Saturation4_UpperSat_a;
9855 if (DeltaTime > PositionFinalLimited) {
9856 L4_MABX_B.Saturation4 = PositionFinalLimited;
9857 } else if (DeltaTime < Time56) {
9858 L4_MABX_B.Saturation4 = Time56;
9859 } else {
9860 L4_MABX_B.Saturation4 = DeltaTime;
9861 }
9862
9863 /* End of Saturate: '<S350>/Saturation4' */
9864
9865 /* Product: '<S350>/Divide2' */
9866 L4_MABX_B.time_to_target_vspd_secs = L4_MABX_B.If_Then_Else_mm.Distance_m /
9867 L4_MABX_B.Saturation4;
9868
9869 /* DigitalClock: '<S348>/Digital Clock' */
9870 L4_MABX_B.DigitalClock_p = L4_MABX_M->Timing.t[0];
9871
9872 /* UnitDelay: '<S348>/Unit_Delay' */
9873 L4_MABX_B.Unit_Delay_b = L4_MABX_DW.Unit_Delay_DSTATE_f;
9874
9875 /* Sum: '<S348>/Subtract' */
9876 L4_MABX_B.Subtract_g = L4_MABX_B.DigitalClock_p - L4_MABX_B.Unit_Delay_b;
9877
9878 /* MinMax: '<S350>/MinMax3' */
9879 DeltaTime = L4_MABX_B.time_to_target_vspd_secs;
9880 PositionFinalLimited = L4_MABX_B.Subtract_g;
9881 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
9882 PositionFinalLimited = DeltaTime;
9883 }
9884
9885 L4_MABX_B.MinMax3_n = PositionFinalLimited;
9886
9887 /* End of MinMax: '<S350>/MinMax3' */
9888
9889 /* Saturate: '<S350>/Saturation1' */
9890 DeltaTime = L4_MABX_B.MinMax3_n;
9891 Time56 = L4_MABX_P.Saturation1_LowerSat_o;
9892 PositionFinalLimited = L4_MABX_P.Saturation1_UpperSat_j;
9893 if (DeltaTime > PositionFinalLimited) {
9894 L4_MABX_B.Saturation1_e = PositionFinalLimited;
9895 } else if (DeltaTime < Time56) {
9896 L4_MABX_B.Saturation1_e = Time56;
9897 } else {
9898 L4_MABX_B.Saturation1_e = DeltaTime;
9899 }
9900
9901 /* End of Saturate: '<S350>/Saturation1' */
9902
9903 /* Product: '<S350>/Divide' */
9904 L4_MABX_B.Divide_e = L4_MABX_B.err_abs / L4_MABX_B.Saturation1_e;
9905
9906 /* Abs: '<S351>/Abs' */
9907 L4_MABX_B.Abs_ma = fabs(L4_MABX_B.Divide_e);
9908
9909 /* Product: '<S351>/Product1' */
9910 L4_MABX_B.Product1_iv = L4_MABX_B.Abs_ma * L4_MABX_B.Subtract_g;
9911
9912 /* Sum: '<S351>/Add1' */
9913 L4_MABX_B.Add1_bf = L4_MABX_B.Init_p + L4_MABX_B.Product1_iv;
9914
9915 /* MinMax: '<S351>/MinMax2' */
9916 DeltaTime = L4_MABX_B.Vehicle_speed_target_o;
9917 PositionFinalLimited = L4_MABX_B.Add1_bf;
9918 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
9919 PositionFinalLimited = DeltaTime;
9920 }
9921
9922 L4_MABX_B.MinMax2_c = PositionFinalLimited;
9923
9924 /* End of MinMax: '<S351>/MinMax2' */
9925
9926 /* Abs: '<S351>/Abs1' */
9927 L4_MABX_B.Abs1_f = fabs(L4_MABX_B.Divide_e);
9928
9929 /* Product: '<S351>/Product2' */
9930 L4_MABX_B.Product2_m = L4_MABX_B.Subtract_g * L4_MABX_B.Abs1_f;
9931
9932 /* Sum: '<S351>/Subtract1' */
9933 L4_MABX_B.Subtract1_h2 = L4_MABX_B.Init_p - L4_MABX_B.Product2_m;
9934
9935 /* MinMax: '<S351>/MinMax1' */
9936 DeltaTime = L4_MABX_B.MinMax2_c;
9937 PositionFinalLimited = L4_MABX_B.Subtract1_h2;
9938 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
9939 PositionFinalLimited = DeltaTime;
9940 }
9941
9942 L4_MABX_B.MinMax1_p = PositionFinalLimited;
9943
9944 /* End of MinMax: '<S351>/MinMax1' */
9945
9946 /* Outputs for Atomic SubSystem: '<S351>/If_Then_Else' */
9947 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_lp, L4_MABX_B.SFunction1_o1_ie,
9948 L4_MABX_B.MinMax1_p, &L4_MABX_B.If_Then_Else_pz);
9949
9950 /* End of Outputs for SubSystem: '<S351>/If_Then_Else' */
9951
9952 /* Outputs for Atomic SubSystem: '<S81>/If_Then_Else' */
9953 L4_MABX_If_Then_Else_g(L4_MABX_B.LogicalOperator2_ft,
9954 L4_MABX_B.If_Then_Else_j.Switch, L4_MABX_B.If_Then_Else_pz.Switch,
9955 &L4_MABX_B.If_Then_Else_ji);
9956
9957 /* End of Outputs for SubSystem: '<S81>/If_Then_Else' */
9958
9959 /* MinMax: '<S81>/MinMax' */
9960 DeltaTime = L4_MABX_B.If_Then_Else_m4.Switch;
9961 PositionFinalLimited = L4_MABX_B.If_Then_Else_bf.Switch;
9962 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
9963 PositionFinalLimited = DeltaTime;
9964 }
9965
9966 Time56 = L4_MABX_B.Vehicle_speed_abs_max;
9967 if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) {
9968 PositionFinalLimited = Time56;
9969 }
9970
9971 Time56 = L4_MABX_B.If_Then_Else_ji.Switch;
9972 if (!((PositionFinalLimited < Time56) || rtIsNaN(Time56))) {
9973 PositionFinalLimited = Time56;
9974 }
9975
9976 L4_MABX_B.MinMax_o = PositionFinalLimited;
9977
9978 /* End of MinMax: '<S81>/MinMax' */
9979
9980 /* Saturate: '<S81>/Saturation8' */
9981 DeltaTime = L4_MABX_B.MinMax_o;
9982 Time56 = L4_MABX_P.Saturation8_LowerSat;
9983 PositionFinalLimited = L4_MABX_P.Saturation8_UpperSat;
9984 if (DeltaTime > PositionFinalLimited) {
9985 L4_MABX_B.Vehicle_speed_target_n = PositionFinalLimited;
9986 } else if (DeltaTime < Time56) {
9987 L4_MABX_B.Vehicle_speed_target_n = Time56;
9988 } else {
9989 L4_MABX_B.Vehicle_speed_target_n = DeltaTime;
9990 }
9991
9992 /* End of Saturate: '<S81>/Saturation8' */
9993
9994 /* Lookup_n-D: '<S200>/2D_Lookup_Table' */
9995 L4_MABX_B.uD_Lookup_Table_l = look2_binlcapw(0.0,
9996 L4_MABX_B.SPN1760_GrossCombinationVehicle, BRK_GOV_FF_DECEL_RATE_STEP_MPV,
9997 BRK_GOV_FF_MASS_STEP_MPV, BRK_GOV_FF_PRESS_KPA_DATA_MPV,
9998 L4_MABX_P.uD_Lookup_Table_maxIndex_e, 16U);
9999
10000 /* Product: '<S106>/Divide' */
10001 L4_MABX_B.Divide_f = L4_MABX_B.uD_Lookup_Table_l /
10002 L4_MABX_B.Primary_brake_circuit_pressur_n;
10003
10004 /* Gain: '<S106>/Gain1' */
10005 L4_MABX_B.Gain1_l = L4_MABX_P.Gain1_Gain_o * L4_MABX_B.Divide_f;
10006
10007 /* Saturate: '<S106>/Saturation1' */
10008 DeltaTime = L4_MABX_B.Gain1_l;
10009 Time56 = L4_MABX_P.Saturation1_LowerSat_n;
10010 PositionFinalLimited = L4_MABX_P.Saturation1_UpperSat_l;
10011 if (DeltaTime > PositionFinalLimited) {
10012 L4_MABX_B.Brake_appl_percent_to_achieve_d = PositionFinalLimited;
10013 } else if (DeltaTime < Time56) {
10014 L4_MABX_B.Brake_appl_percent_to_achieve_d = Time56;
10015 } else {
10016 L4_MABX_B.Brake_appl_percent_to_achieve_d = DeltaTime;
10017 }
10018
10019 /* End of Saturate: '<S106>/Saturation1' */
10020
10021 /* Saturate: '<S81>/Saturation2' incorporates:
10022 * Constant: '<S81>/ACCEL_LIM_MS2_APV'
10023 */
10024 DeltaTime = L4_MABX_P.ACCEL_LIM_MS2_APV_Value;
10025 Time56 = L4_MABX_P.Saturation2_LowerSat_l;
10026 PositionFinalLimited = L4_MABX_P.Saturation2_UpperSat_a;
10027 if (DeltaTime > PositionFinalLimited) {
10028 L4_MABX_B.ACCEL_LIM_MS2_APV_b = PositionFinalLimited;
10029 } else if (DeltaTime < Time56) {
10030 L4_MABX_B.ACCEL_LIM_MS2_APV_b = Time56;
10031 } else {
10032 L4_MABX_B.ACCEL_LIM_MS2_APV_b = DeltaTime;
10033 }
10034
10035 /* End of Saturate: '<S81>/Saturation2' */
10036
10037 /* Lookup_n-D: '<S201>/2D_Lookup_Table' */
10038 L4_MABX_B.uD_Lookup_Table_i = look2_binlcapw(L4_MABX_B.ACCEL_LIM_MS2_APV_b,
10039 L4_MABX_B.SPN1760_GrossCombinationVehicle, BRK_GOV_FF_DECEL_RATE_STEP_MPV,
10040 BRK_GOV_FF_MASS_STEP_MPV, BRK_GOV_FF_PRESS_KPA_DATA_MPV,
10041 L4_MABX_P.uD_Lookup_Table_maxIndex_n, 16U);
10042
10043 /* Product: '<S106>/Divide1' */
10044 L4_MABX_B.Divide1_f = L4_MABX_B.uD_Lookup_Table_i /
10045 L4_MABX_B.Primary_brake_circuit_pressur_n;
10046
10047 /* Gain: '<S106>/Gain2' */
10048 L4_MABX_B.Gain2_e = L4_MABX_P.Gain2_Gain_b * L4_MABX_B.Divide1_f;
10049
10050 /* Saturate: '<S106>/Saturation2' */
10051 DeltaTime = L4_MABX_B.Gain2_e;
10052 Time56 = L4_MABX_P.Saturation2_LowerSat_o;
10053 PositionFinalLimited = L4_MABX_P.Saturation2_UpperSat_b;
10054 if (DeltaTime > PositionFinalLimited) {
10055 L4_MABX_B.Brake_appl_percent_for_maximum_ = PositionFinalLimited;
10056 } else if (DeltaTime < Time56) {
10057 L4_MABX_B.Brake_appl_percent_for_maximum_ = Time56;
10058 } else {
10059 L4_MABX_B.Brake_appl_percent_for_maximum_ = DeltaTime;
10060 }
10061
10062 /* End of Saturate: '<S106>/Saturation2' */
10063
10064 /* DataTypeConversion: '<S77>/Data Type Conversion2' */
10065 L4_MABX_B.DataTypeConversion2_l = L4_MABX_B.SPN1760_GrossCombinationVehicle;
10066
10067 /* Outputs for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' incorporates:
10068 * EnablePort: '<S103>/Enable'
10069 */
10070 if (L4_MABX_B.F_Brake_control_active) {
10071 if (!L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba) {
10072 /* InitializeConditions for UnitDelay: '<S146>/Unit_Delay' */
10073 L4_MABX_DW.Unit_Delay_DSTATE_eu = L4_MABX_P.Unit_Delay_InitialCondition_f;
10074
10075 /* InitializeConditions for UnitDelay: '<S153>/Unit_Delay' */
10076 L4_MABX_DW.Unit_Delay_DSTATE_n = L4_MABX_P.Unit_Delay_InitialCondition_jb;
10077
10078 /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay1' */
10079 L4_MABX_DW.Unit_Delay1_DSTATE_f = L4_MABX_P.Unit_Delay1_InitialCondition_p;
10080
10081 /* InitializeConditions for UnitDelay: '<S174>/Unit_Delay' */
10082 L4_MABX_DW.Unit_Delay_DSTATE_g4 = L4_MABX_P.Unit_Delay_InitialCondition_lq;
10083
10084 /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay2' */
10085 L4_MABX_DW.FixPtUnitDelay2_DSTATE_o4 =
10086 L4_MABX_P.FixPtUnitDelay2_InitialCondit_p;
10087
10088 /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay1' */
10089 L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2 =
10090 L4_MABX_P.FixPtUnitDelay1_InitialCondit_b;
10091
10092 /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay2' */
10093 L4_MABX_DW.Unit_Delay2_DSTATE_c = L4_MABX_P.Unit_Delay2_InitialCondition_b;
10094
10095 /* InitializeConditions for UnitDelay: '<S145>/Unit_Delay' */
10096 L4_MABX_DW.Unit_Delay_DSTATE_h = L4_MABX_P.Unit_Delay_InitialCondition_h;
10097 L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba = true;
10098 }
10099
10100 /* Lookup_n-D: '<S147>/1D_Lookup_Table' */
10101 L4_MABX_B.uD_Lookup_Table_f = look1_binlcapw(L4_MABX_B.DataTypeConversion2_l,
10102 BRK_DEM_MASS_STEP_MPV, BRK_DEM_KP_DATA_MPV, 7U);
10103
10104 /* Lookup_n-D: '<S148>/1D_Lookup_Table' */
10105 L4_MABX_B.uD_Lookup_Table_p = look1_binlcapw(L4_MABX_B.DataTypeConversion2_l,
10106 BRK_DEM_MASS_STEP_MPV, BRK_DEM_KI_DATA_MPV, 7U);
10107
10108 /* Lookup_n-D: '<S149>/1D_Lookup_Table' */
10109 L4_MABX_B.uD_Lookup_Table_o5 = look1_binlcapw
10110 (L4_MABX_B.DataTypeConversion2_l, BRK_DEM_MASS_STEP_MPV,
10111 BRK_DEM_KD_DATA_MPV, 7U);
10112
10113 /* Abs: '<S150>/Abs' */
10114 L4_MABX_B.Abs_k1 = fabs(L4_MABX_B.uD_Lookup_Table_p);
10115
10116 /* Abs: '<S150>/Abs1' */
10117 L4_MABX_B.Abs1_eg = fabs(L4_MABX_B.uD_Lookup_Table_o5);
10118
10119 /* DigitalClock: '<S146>/Digital Clock' */
10120 L4_MABX_B.DigitalClock_n = L4_MABX_M->Timing.t[0];
10121
10122 /* UnitDelay: '<S146>/Unit_Delay' */
10123 L4_MABX_B.Unit_Delay_ko = L4_MABX_DW.Unit_Delay_DSTATE_eu;
10124
10125 /* Sum: '<S146>/Subtract' */
10126 L4_MABX_B.Subtract_ac = L4_MABX_B.DigitalClock_n - L4_MABX_B.Unit_Delay_ko;
10127
10128 /* UnitDelay: '<S153>/Unit_Delay' */
10129 L4_MABX_B.Unit_Delay_m1 = L4_MABX_DW.Unit_Delay_DSTATE_n;
10130
10131 /* Logic: '<S153>/Logical Operator1' incorporates:
10132 * Constant: '<S103>/CPV2'
10133 */
10134 L4_MABX_B.LogicalOperator1_pf = (L4_MABX_B.Unit_Delay_m1 ||
10135 L4_MABX_P.CPV2_Value_a);
10136
10137 /* UnitDelay: '<S173>/Unit_Delay1' */
10138 L4_MABX_B.Unit_Delay1_jk = L4_MABX_DW.Unit_Delay1_DSTATE_f;
10139
10140 /* Logic: '<S173>/Logical Operator' */
10141 L4_MABX_B.LogicalOperator_lo = (L4_MABX_B.LogicalOperator1_pf ||
10142 L4_MABX_B.Unit_Delay1_jk);
10143
10144 /* UnitDelay: '<S174>/Unit_Delay' */
10145 L4_MABX_B.Unit_Delay_li = L4_MABX_DW.Unit_Delay_DSTATE_g4;
10146
10147 /* Logic: '<S174>/Logical Operator1' */
10148 L4_MABX_B.LogicalOperator1_oy = (L4_MABX_B.LogicalOperator1_pf ||
10149 L4_MABX_B.Unit_Delay_li);
10150
10151 /* UnitDelay: '<S178>/FixPt Unit Delay2' */
10152 L4_MABX_B.FixPtUnitDelay2_mf = L4_MABX_DW.FixPtUnitDelay2_DSTATE_o4;
10153
10154 /* UnitDelay: '<S178>/FixPt Unit Delay1' */
10155 L4_MABX_B.Xold_c = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2;
10156
10157 /* Switch: '<S178>/Init' */
10158 if (L4_MABX_B.FixPtUnitDelay2_mf != 0) {
10159 L4_MABX_B.Init_cy = L4_MABX_B.Vehicle_speed_target_n;
10160 } else {
10161 L4_MABX_B.Init_cy = L4_MABX_B.Xold_c;
10162 }
10163
10164 /* End of Switch: '<S178>/Init' */
10165
10166 /* Abs: '<S174>/Abs' incorporates:
10167 * Constant: '<S103>/BRK_DECEL_DEM_SLEW_INC_APV'
10168 */
10169 L4_MABX_B.Abs_o = fabs(L4_MABX_P.BRK_DECEL_DEM_SLEW_INC_APV_Valu);
10170
10171 /* Product: '<S174>/Product1' */
10172 L4_MABX_B.Product1_hy = L4_MABX_B.Abs_o * L4_MABX_B.Subtract_ac;
10173
10174 /* Sum: '<S174>/Add1' */
10175 L4_MABX_B.Add1_o = L4_MABX_B.Init_cy + L4_MABX_B.Product1_hy;
10176
10177 /* MinMax: '<S174>/MinMax2' */
10178 DeltaTime = L4_MABX_B.Vehicle_speed_target_n;
10179 PositionFinalLimited = L4_MABX_B.Add1_o;
10180 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
10181 PositionFinalLimited = DeltaTime;
10182 }
10183
10184 L4_MABX_B.MinMax2_p = PositionFinalLimited;
10185
10186 /* End of MinMax: '<S174>/MinMax2' */
10187
10188 /* Abs: '<S174>/Abs1' incorporates:
10189 * Constant: '<S103>/BRK_DECEL_DEM_SLEW_DEC_APV'
10190 */
10191 L4_MABX_B.Abs1_g = fabs(L4_MABX_P.BRK_DECEL_DEM_SLEW_DEC_APV_Valu);
10192
10193 /* Product: '<S174>/Product2' */
10194 L4_MABX_B.Product2_fh = L4_MABX_B.Subtract_ac * L4_MABX_B.Abs1_g;
10195
10196 /* Sum: '<S174>/Subtract1' */
10197 L4_MABX_B.Subtract1_f = L4_MABX_B.Init_cy - L4_MABX_B.Product2_fh;
10198
10199 /* MinMax: '<S174>/MinMax1' */
10200 DeltaTime = L4_MABX_B.MinMax2_p;
10201 PositionFinalLimited = L4_MABX_B.Subtract1_f;
10202 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
10203 PositionFinalLimited = DeltaTime;
10204 }
10205
10206 L4_MABX_B.MinMax1_hl = PositionFinalLimited;
10207
10208 /* End of MinMax: '<S174>/MinMax1' */
10209
10210 /* Outputs for Atomic SubSystem: '<S174>/If_Then_Else' */
10211 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_oy,
10212 L4_MABX_B.DataTypeConversion5_o, L4_MABX_B.MinMax1_hl,
10213 &L4_MABX_B.If_Then_Else_iy);
10214
10215 /* End of Outputs for SubSystem: '<S174>/If_Then_Else' */
10216
10217 /* Sum: '<S151>/Subtract' */
10218 L4_MABX_B.Subtract_jh = L4_MABX_B.If_Then_Else_iy.Switch -
10219 L4_MABX_B.DataTypeConversion5_o;
10220
10221 /* MinMax: '<S173>/MinMax1' incorporates:
10222 * Constant: '<S103>/BRK_DECEL_DEM_T_FILT_CTRL_ERROR_APV'
10223 */
10224 DeltaTime = L4_MABX_B.Subtract_ac;
10225 PositionFinalLimited = L4_MABX_P.BRK_DECEL_DEM_T_FILT_CTRL_ERROR;
10226 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
10227 PositionFinalLimited = DeltaTime;
10228 }
10229
10230 L4_MABX_B.MinMax1_jg = PositionFinalLimited;
10231
10232 /* End of MinMax: '<S173>/MinMax1' */
10233
10234 /* Saturate: '<S173>/Saturation' */
10235 DeltaTime = L4_MABX_B.MinMax1_jg;
10236 Time56 = L4_MABX_P.Saturation_LowerSat_g;
10237 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_o;
10238 if (DeltaTime > PositionFinalLimited) {
10239 L4_MABX_B.Saturation_mo = PositionFinalLimited;
10240 } else if (DeltaTime < Time56) {
10241 L4_MABX_B.Saturation_mo = Time56;
10242 } else {
10243 L4_MABX_B.Saturation_mo = DeltaTime;
10244 }
10245
10246 /* End of Saturate: '<S173>/Saturation' */
10247
10248 /* Product: '<S173>/Divide' */
10249 L4_MABX_B.Divide_af = L4_MABX_B.Subtract_ac / L4_MABX_B.Saturation_mo;
10250
10251 /* Product: '<S173>/Product2' */
10252 L4_MABX_B.Product2_ce = L4_MABX_B.Subtract_jh * L4_MABX_B.Divide_af;
10253
10254 /* Sum: '<S173>/Subtract1' incorporates:
10255 * Constant: '<S173>/Constant1'
10256 */
10257 L4_MABX_B.Subtract1_cr = L4_MABX_P.Constant1_Value_o - L4_MABX_B.Divide_af;
10258
10259 /* UnitDelay: '<S173>/Unit_Delay2' */
10260 L4_MABX_B.Unit_Delay2_a = L4_MABX_DW.Unit_Delay2_DSTATE_c;
10261
10262 /* Product: '<S173>/Product1' */
10263 L4_MABX_B.Product1_ch = L4_MABX_B.Subtract1_cr * L4_MABX_B.Unit_Delay2_a;
10264
10265 /* Sum: '<S173>/Add1' */
10266 L4_MABX_B.Add1_hl = L4_MABX_B.Product2_ce + L4_MABX_B.Product1_ch;
10267
10268 /* Outputs for Atomic SubSystem: '<S173>/If_Then_Else' */
10269 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_lo, L4_MABX_B.Subtract_jh,
10270 L4_MABX_B.Add1_hl, &L4_MABX_B.If_Then_Else_bc);
10271
10272 /* End of Outputs for SubSystem: '<S173>/If_Then_Else' */
10273
10274 /* RelationalOperator: '<S158>/Compare' incorporates:
10275 * Constant: '<S158>/Constant'
10276 */
10277 L4_MABX_B.Compare_ni = (L4_MABX_B.Abs1_eg >
10278 L4_MABX_P.CompareToConstant1_const_m);
10279
10280 /* Outputs for Enabled SubSystem: '<S150>/Calculate_D_term' */
10281
10282 /* Constant: '<S103>/BRK_DECEL_DEM_T_FILT_D_APV' */
10283 L4_MABX_Calculate_D_term(L4_MABX_B.Compare_ni, L4_MABX_B.uD_Lookup_Table_o5,
10284 L4_MABX_B.Subtract_ac, L4_MABX_B.LogicalOperator1_pf,
10285 L4_MABX_B.If_Then_Else_bc.Switch,
10286 L4_MABX_P.BRK_DECEL_DEM_T_FILT_D_APV_Valu, &L4_MABX_B.Calculate_D_term_p,
10287 &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p);
10288
10289 /* End of Outputs for SubSystem: '<S150>/Calculate_D_term' */
10290
10291 /* Product: '<S156>/Product' */
10292 L4_MABX_B.Product_f = L4_MABX_B.uD_Lookup_Table_f *
10293 L4_MABX_B.If_Then_Else_bc.Switch;
10294
10295 /* UnitDelay: '<S145>/Unit_Delay' */
10296 L4_MABX_B.Unit_Delay_fg = L4_MABX_DW.Unit_Delay_DSTATE_h;
10297
10298 /* RelationalOperator: '<S157>/Compare' incorporates:
10299 * Constant: '<S157>/Constant'
10300 */
10301 L4_MABX_B.Compare_dl = (L4_MABX_B.Abs_k1 >
10302 L4_MABX_P.CompareToConstant_const_c);
10303
10304 /* Outputs for Enabled SubSystem: '<S150>/Calculate_I_term' */
10305
10306 /* Constant: '<S103>/BRK_DECEL_DEM_AW_COND_INT_APV' incorporates:
10307 * Constant: '<S103>/BRK_DECEL_DEM_AW_HYSTERESIS_APV'
10308 * Constant: '<S103>/CPV1'
10309 */
10310 L4_MABX_Calculate_I_term(L4_MABX_B.Compare_dl, L4_MABX_B.Product_f,
10311 L4_MABX_B.uD_Lookup_Table_p, L4_MABX_B.Brake_appl_percent,
10312 L4_MABX_B.If_Then_Else_bc.Switch, L4_MABX_B.LogicalOperator1_pf,
10313 L4_MABX_B.Subtract_ac, L4_MABX_B.Brake_appl_percent_to_achieve_d,
10314 L4_MABX_P.BRK_DECEL_DEM_AW_COND_INT_APV_V,
10315 L4_MABX_P.BRK_DECEL_DEM_AW_HYSTERESIS_APV, L4_MABX_P.CPV1_Value_no,
10316 L4_MABX_B.Unit_Delay_fg, &L4_MABX_B.Calculate_I_term_e,
10317 &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e);
10318
10319 /* End of Outputs for SubSystem: '<S150>/Calculate_I_term' */
10320
10321 /* RelationalOperator: '<S176>/min_relop' incorporates:
10322 * Constant: '<S103>/BRK_DECEL_DEM_SLEW_INC_APV'
10323 * Constant: '<S176>/min_val'
10324 */
10325 L4_MABX_B.min_relop_a5 = (L4_MABX_P.CheckStaticLowerBound_min_d <=
10326 L4_MABX_P.BRK_DECEL_DEM_SLEW_INC_APV_Valu);
10327
10328 /* Assertion: '<S176>/Assertion' */
10329 utAssert(L4_MABX_B.min_relop_a5);
10330
10331 /* Sum: '<S152>/Add' */
10332 L4_MABX_B.Add_mh = ((L4_MABX_B.Product_f +
10333 L4_MABX_B.Calculate_I_term_e.If_Then_Else.Switch) +
10334 L4_MABX_B.Calculate_D_term_p.Subtract) +
10335 L4_MABX_B.Brake_appl_percent_to_achieve_d;
10336
10337 /* RelationalOperator: '<S179>/Relational Operator1' */
10338 L4_MABX_B.RelationalOperator1_k = (L4_MABX_B.Add_mh >=
10339 L4_MABX_B.Brake_appl_percent_for_maximum_);
10340
10341 /* RelationalOperator: '<S179>/Relational Operator' incorporates:
10342 * Constant: '<S103>/CPV'
10343 */
10344 L4_MABX_B.RelationalOperator_m = (L4_MABX_B.Add_mh <= L4_MABX_P.CPV_Value_i);
10345
10346 /* Outputs for Atomic SubSystem: '<S179>/If_Then_Else1' */
10347
10348 /* Constant: '<S103>/CPV' */
10349 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_m, L4_MABX_P.CPV_Value_i,
10350 L4_MABX_B.Add_mh, &L4_MABX_B.If_Then_Else1_gx);
10351
10352 /* End of Outputs for SubSystem: '<S179>/If_Then_Else1' */
10353
10354 /* Outputs for Atomic SubSystem: '<S179>/If_Then_Else' */
10355 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_k,
10356 L4_MABX_B.Brake_appl_percent_for_maximum_,
10357 L4_MABX_B.If_Then_Else1_gx.Switch,
10358 &L4_MABX_B.If_Then_Else_fo);
10359
10360 /* End of Outputs for SubSystem: '<S179>/If_Then_Else' */
10361 } else {
10362 if (L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba) {
10363 /* Disable for Enabled SubSystem: '<S150>/Calculate_D_term' */
10364 if (L4_MABX_DW.Calculate_D_term_p.Calculate_D_term_MODE) {
10365 L4_Calculate_D_term_Disable(&L4_MABX_B.Calculate_D_term_p,
10366 &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p);
10367 }
10368
10369 /* End of Disable for SubSystem: '<S150>/Calculate_D_term' */
10370
10371 /* Disable for Enabled SubSystem: '<S150>/Calculate_I_term' */
10372 if (L4_MABX_DW.Calculate_I_term_e.Calculate_I_term_MODE) {
10373 L4_Calculate_I_term_Disable(&L4_MABX_B.Calculate_I_term_e,
10374 &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e);
10375 }
10376
10377 /* End of Disable for SubSystem: '<S150>/Calculate_I_term' */
10378
10379 /* Disable for Outport: '<S103>/PID_output' */
10380 L4_MABX_B.If_Then_Else_fo.Switch = L4_MABX_P.PID_output_Y0_p;
10381 L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba = false;
10382 }
10383 }
10384
10385 /* End of Outputs for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */
10386
10387 /* RelationalOperator: '<S104>/Relational Operator2' incorporates:
10388 * Constant: '<S104>/CPV2'
10389 */
10390 L4_MABX_B.F_Driver_braking = (L4_MABX_B.XPRControlMode ==
10391 L4_MABX_P.CPV2_Value_hm);
10392
10393 /* Logic: '<S104>/Logical Operator2' */
10394 L4_MABX_B.F_Operator_brake_appl = (L4_MABX_B.If_Then_Else_la.Switch &&
10395 L4_MABX_B.F_Driver_braking);
10396
10397 /* RelationalOperator: '<S104>/Relational Operator5' incorporates:
10398 * Constant: '<S104>/BENDIX_2C2_BRAKE_APPL_THRESHOLD_KPA_APV'
10399 */
10400 L4_MABX_B.RelationalOperator5[0] = (L4_MABX_B.Bendix_2C2_Primary_brake_circui >
10401 L4_MABX_P.BENDIX_2C2_BRAKE_APPL_THRESHOLD);
10402 L4_MABX_B.RelationalOperator5[1] = (L4_MABX_B.Bendix_2C2_Secondary_brake_circ >
10403 L4_MABX_P.BENDIX_2C2_BRAKE_APPL_THRESHOLD);
10404
10405 /* Logic: '<S104>/Logical Operator6' */
10406 L4_MABX_B.F_Bendix_2C2_service_brake_pres = (L4_MABX_B.RelationalOperator5[0] ||
10407 L4_MABX_B.RelationalOperator5[1]);
10408
10409 /* RelationalOperator: '<S104>/Relational Operator' incorporates:
10410 * Constant: '<S104>/CPV'
10411 */
10412 L4_MABX_B.F_Bendix_2C2_braking = (L4_MABX_B.XPRControlMode ==
10413 L4_MABX_P.CPV_Value_e);
10414
10415 /* Logic: '<S104>/Logical Operator7' */
10416 L4_MABX_B.F_ADAS_brake_appl = (L4_MABX_B.If_Then_Else_la.Switch &&
10417 L4_MABX_B.F_Bendix_2C2_braking && L4_MABX_B.F_Bendix_2C2_service_brake_pres);
10418
10419 /* RelationalOperator: '<S104>/Relational Operator1' incorporates:
10420 * Constant: '<S104>/CPV1'
10421 */
10422 L4_MABX_B.F_ADAS_brake_error = (L4_MABX_B.XPRErrorState !=
10423 L4_MABX_P.CPV1_Value_i5);
10424
10425 /* Lookup_n-D: '<S199>/2D_Lookup_Table' */
10426 L4_MABX_B.uD_Lookup_Table_le = look2_binlcapw
10427 (L4_MABX_B.brake_system_avg_appl_pressure_,
10428 L4_MABX_B.SPN1760_GrossCombinationVehicle, BRK_GOV_FF_PRESS_KPA_STEP_MPV,
10429 BRK_GOV_FF_MASS_STEP_MPV, BRK_GOV_FF_DECEL_RATE_DATA_MPV,
10430 L4_MABX_P.uD_Lookup_Table_maxIndex_m, 16U);
10431
10432 /* Saturate: '<S106>/Saturation4' */
10433 DeltaTime = L4_MABX_B.uD_Lookup_Table_le;
10434 Time56 = L4_MABX_P.Saturation4_LowerSat_a;
10435 PositionFinalLimited = L4_MABX_P.Saturation4_UpperSat_f;
10436 if (DeltaTime > PositionFinalLimited) {
10437 L4_MABX_B.Decel_rate_calculated_ms2 = PositionFinalLimited;
10438 } else if (DeltaTime < Time56) {
10439 L4_MABX_B.Decel_rate_calculated_ms2 = Time56;
10440 } else {
10441 L4_MABX_B.Decel_rate_calculated_ms2 = DeltaTime;
10442 }
10443
10444 /* End of Saturate: '<S106>/Saturation4' */
10445
10446 /* DataTypeConversion: '<S107>/Data Type Conversion' */
10447 L4_MABX_B.DataTypeConversion_pp = L4_MABX_B.SFunction1_o1_i4;
10448
10449 /* DataTypeConversion: '<S107>/Data Type Conversion1' */
10450 L4_MABX_B.DataTypeConversion1_k5 = L4_MABX_B.SFunction1_o2_da;
10451
10452 /* Sum: '<S107>/Add' */
10453 L4_MABX_B.Add_m = L4_MABX_B.DataTypeConversion_pp +
10454 L4_MABX_B.DataTypeConversion1_k5;
10455
10456 /* UnitDelay: '<S107>/Unit_Delay' */
10457 L4_MABX_B.Unit_Delay_dy = L4_MABX_DW.Unit_Delay_DSTATE_eu4;
10458
10459 /* UnitDelay: '<S203>/Unit_Delay1' */
10460 L4_MABX_B.Unit_Delay1_k = L4_MABX_DW.Unit_Delay1_DSTATE_d;
10461
10462 /* Logic: '<S203>/Logical Operator' */
10463 L4_MABX_B.LogicalOperator_fc = (L4_MABX_B.Unit_Delay_dy ||
10464 L4_MABX_B.Unit_Delay1_k);
10465
10466 /* Gain: '<S107>/Gain' */
10467 L4_MABX_B.Gain_j = L4_MABX_P.Gain_Gain_f * L4_MABX_B.Add_m;
10468
10469 /* MinMax: '<S203>/MinMax1' incorporates:
10470 * Constant: '<S107>/Constant10'
10471 * Constant: '<S107>/VSPD_CAN_HRW_0B_FILT_T_APV'
10472 */
10473 DeltaTime = L4_MABX_P.Constant10_Value;
10474 PositionFinalLimited = L4_MABX_P.VSPD_CAN_HRW_0B_FILT_T_APV_Valu;
10475 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
10476 PositionFinalLimited = DeltaTime;
10477 }
10478
10479 L4_MABX_B.MinMax1_i = PositionFinalLimited;
10480
10481 /* End of MinMax: '<S203>/MinMax1' */
10482
10483 /* Saturate: '<S203>/Saturation' */
10484 DeltaTime = L4_MABX_B.MinMax1_i;
10485 Time56 = L4_MABX_P.Saturation_LowerSat_b;
10486 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_l;
10487 if (DeltaTime > PositionFinalLimited) {
10488 L4_MABX_B.Saturation_n = PositionFinalLimited;
10489 } else if (DeltaTime < Time56) {
10490 L4_MABX_B.Saturation_n = Time56;
10491 } else {
10492 L4_MABX_B.Saturation_n = DeltaTime;
10493 }
10494
10495 /* End of Saturate: '<S203>/Saturation' */
10496
10497 /* Product: '<S203>/Divide' incorporates:
10498 * Constant: '<S107>/Constant10'
10499 */
10500 L4_MABX_B.Divide_a = L4_MABX_P.Constant10_Value / L4_MABX_B.Saturation_n;
10501
10502 /* Product: '<S203>/Product2' */
10503 L4_MABX_B.Product2_o = L4_MABX_B.Gain_j * L4_MABX_B.Divide_a;
10504
10505 /* Sum: '<S203>/Subtract1' incorporates:
10506 * Constant: '<S203>/Constant1'
10507 */
10508 L4_MABX_B.Subtract1_e = L4_MABX_P.Constant1_Value_od - L4_MABX_B.Divide_a;
10509
10510 /* UnitDelay: '<S203>/Unit_Delay2' */
10511 L4_MABX_B.Unit_Delay2_g = L4_MABX_DW.Unit_Delay2_DSTATE_e;
10512
10513 /* Product: '<S203>/Product1' */
10514 L4_MABX_B.Product1_o = L4_MABX_B.Subtract1_e * L4_MABX_B.Unit_Delay2_g;
10515
10516 /* Sum: '<S203>/Add1' */
10517 L4_MABX_B.Add1_n1 = L4_MABX_B.Product2_o + L4_MABX_B.Product1_o;
10518
10519 /* Outputs for Atomic SubSystem: '<S203>/If_Then_Else' */
10520 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_fc, L4_MABX_B.Gain_j,
10521 L4_MABX_B.Add1_n1, &L4_MABX_B.If_Then_Else_ga);
10522
10523 /* End of Outputs for SubSystem: '<S203>/If_Then_Else' */
10524
10525 /* SampleTimeMath: '<S202>/TSamp'
10526 *
10527 * About '<S202>/TSamp':
10528 * y = u * K where K = 1 / ( w * Ts )
10529 */
10530 L4_MABX_B.TSamp = L4_MABX_B.If_Then_Else_ga.Switch * L4_MABX_P.TSamp_WtEt;
10531
10532 /* UnitDelay: '<S202>/UD' */
10533 L4_MABX_B.Uk1_b = L4_MABX_DW.UD_DSTATE;
10534
10535 /* Sum: '<S202>/Diff' */
10536 L4_MABX_B.Diff = L4_MABX_B.TSamp - L4_MABX_B.Uk1_b;
10537
10538 /* MinMax: '<S77>/MinMax' */
10539 DeltaTime = L4_MABX_B.If_Then_Else_nj.Switch;
10540 PositionFinalLimited = L4_MABX_B.If_Then_Else_fo.Switch;
10541 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
10542 PositionFinalLimited = DeltaTime;
10543 }
10544
10545 L4_MABX_B.BrakingPID_Y_percent = PositionFinalLimited;
10546
10547 /* End of MinMax: '<S77>/MinMax' */
10548
10549 /* Gain: '<S77>/Gain' */
10550 L4_MABX_B.BrakingPID_Y_k5 = L4_MABX_P.Gain_Gain_no *
10551 L4_MABX_B.BrakingPID_Y_percent;
10552
10553 /* DataTypeConversion: '<S79>/Data Type Conversion' */
10554 L4_MABX_B.DataTypeConversion_de = L4_MABX_B.AutonomousEnabled_d;
10555
10556 /* DataTypeConversion: '<S79>/Data Type Conversion2' */
10557 L4_MABX_B.DataTypeConversion2_lf = (real32_T)L4_MABX_B.SFunction1_o1_ie;
10558
10559 /* DataTypeConversion: '<S79>/Data Type Conversion1' */
10560 PositionFinalLimited = floor(L4_MABX_B.SFunction1_o8_ct);
10561 if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) {
10562 PositionFinalLimited = 0.0;
10563 } else {
10564 PositionFinalLimited = fmod(PositionFinalLimited, 256.0);
10565 }
10566
10567 L4_MABX_B.DataTypeConversion1_f1 = (uint8_T)(PositionFinalLimited < 0.0 ?
10568 (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T)
10569 (uint8_T)PositionFinalLimited);
10570
10571 /* End of DataTypeConversion: '<S79>/Data Type Conversion1' */
10572
10573 /* Chart: '<S79>/Chart' incorporates:
10574 * Constant: '<S79>/Constant'
10575 */
10576 /* Gateway: STATE_CONTROL_10ms/Chart */
10577 /* During: STATE_CONTROL_10ms/Chart */
10578 if (L4_MABX_DW.is_active_c19_SUB_L4_Task_10ms_ == 0U) {
10579 /* Entry: STATE_CONTROL_10ms/Chart */
10580 L4_MABX_DW.is_active_c19_SUB_L4_Task_10ms_ = 1U;
10581
10582 /* Entry Internal: STATE_CONTROL_10ms/Chart */
10583 /* Transition: '<S207>:2' */
10584 L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_Init;
10585
10586 /* Entry 'Init': '<S207>:1' */
10587 L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_INIT;
10588 } else {
10589 switch (L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA) {
10590 case L4_MABX_IN_Init:
10591 L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_INIT;
10592
10593 /* During 'Init': '<S207>:1' */
10594 if (!L4_MABX_P.Constant_Value_cp) {
10595 /* Transition: '<S207>:9' */
10596 L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_OperatorDisabled;
10597
10598 /* Entry 'OperatorDisabled': '<S207>:3' */
10599 L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_OPERATOR_DISABLED;
10600 }
10601 break;
10602
10603 case L4_MABX_IN_OperatorDisabled:
10604 L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_OPERATOR_DISABLED;
10605
10606 /* During 'OperatorDisabled': '<S207>:3' */
10607 if (L4_MABX_B.DataTypeConversion_de) {
10608 /* Transition: '<S207>:11' */
10609 L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_OperatorEnabled;
10610
10611 /* Entry 'OperatorEnabled': '<S207>:10' */
10612 L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_AUTO_CTRL_ENABLED;
10613
10614 /* Entry Internal 'OperatorEnabled': '<S207>:10' */
10615 /* Transition: '<S207>:16' */
10616 /* Entry 'AutoControlEnabled': '<S207>:13' */
10617 /* Entry Internal 'AutoControlEnabled': '<S207>:13' */
10618 /* Transition: '<S207>:15' */
10619 /* Entry 'init': '<S207>:14' */
10620 L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_INIT;
10621 }
10622 break;
10623
10624 default:
10625 L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_AUTO_CTRL_ENABLED;
10626
10627 /* During 'OperatorEnabled': '<S207>:10' */
10628 if ((!L4_MABX_B.DataTypeConversion_de) || L4_MABX_P.Constant_Value_cp) {
10629 /* Transition: '<S207>:12' */
10630 /* Exit Internal 'OperatorEnabled': '<S207>:10' */
10631 /* Exit Internal 'AutoControlEnabled': '<S207>:13' */
10632 L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_OperatorDisabled;
10633
10634 /* Entry 'OperatorDisabled': '<S207>:3' */
10635 L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_OPERATOR_DISABLED;
10636 } else {
10637 /* During 'AutoControlEnabled': '<S207>:13' */
10638 L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_INIT;
10639
10640 /* During 'init': '<S207>:14' */
10641 }
10642 break;
10643 }
10644 }
10645
10646 /* End of Chart: '<S79>/Chart' */
10647
10648 /* Outputs for Enabled SubSystem: '<S79>/Engine_speed_target' incorporates:
10649 * EnablePort: '<S210>/Enable'
10650 */
10651 if (L4_MABX_B.LogicalOperator_ke) {
10652 if (!L4_MABX_DW.Engine_speed_target_MODE) {
10653 L4_MABX_DW.Engine_speed_target_MODE = true;
10654 }
10655
10656 /* Gain: '<S210>/KPH_TO_MPH' */
10657 L4_MABX_B.KPH_TO_MPH = L4_MABX_P.KPH_TO_MPH_Gain *
10658 L4_MABX_B.VSPD_TARGET_KPH_APV_g;
10659
10660 /* MinMax: '<S210>/MinMax' incorporates:
10661 * Constant: '<S210>/Constant2'
10662 * Constant: '<S210>/TIRE_DIAM_INCHES_APV'
10663 */
10664 DeltaTime = L4_MABX_P.TIRE_DIAM_INCHES_APV_Value;
10665 PositionFinalLimited = L4_MABX_P.Constant2_Value_m;
10666 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
10667 PositionFinalLimited = DeltaTime;
10668 }
10669
10670 L4_MABX_B.MinMax_dl = PositionFinalLimited;
10671
10672 /* End of MinMax: '<S210>/MinMax' */
10673
10674 /* Product: '<S210>/Divide' incorporates:
10675 * Constant: '<S210>/CONVERSION_CONSTANT_CPV'
10676 * Constant: '<S210>/REAR_AXLE_RATIO_VALUE_APV'
10677 */
10678 L4_MABX_B.Divide_p = L4_MABX_B.KPH_TO_MPH *
10679 L4_MABX_B.SPN526_TransActualGearRatio *
10680 L4_MABX_P.REAR_AXLE_RATIO_VALUE_APV_Value *
10681 L4_MABX_P.CONVERSION_CONSTANT_CPV_Value / L4_MABX_B.MinMax_dl;
10682
10683 /* MinMax: '<S210>/MinMax1' incorporates:
10684 * Constant: '<S210>/Constant1'
10685 */
10686 DeltaTime = L4_MABX_B.Divide_p;
10687 PositionFinalLimited = L4_MABX_P.Constant1_Value_fx;
10688 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
10689 PositionFinalLimited = DeltaTime;
10690 }
10691
10692 L4_MABX_B.MinMax1_n = PositionFinalLimited;
10693
10694 /* End of MinMax: '<S210>/MinMax1' */
10695 } else {
10696 if (L4_MABX_DW.Engine_speed_target_MODE) {
10697 /* Disable for Outport: '<S210>/Out1' */
10698 L4_MABX_B.MinMax1_n = L4_MABX_P.Out1_Y0;
10699 L4_MABX_DW.Engine_speed_target_MODE = false;
10700 }
10701 }
10702
10703 /* End of Outputs for SubSystem: '<S79>/Engine_speed_target' */
10704
10705 /* RelationalOperator: '<S211>/Relational Operator1' incorporates:
10706 * Constant: '<S211>/CPV3'
10707 */
10708 L4_MABX_B.RelationalOperator1_c = (L4_MABX_B.SFunction1_o1_ie <=
10709 L4_MABX_P.CPV3_Value_n);
10710
10711 /* RelationalOperator: '<S211>/Relational Operator3' incorporates:
10712 * Constant: '<S211>/CPV1'
10713 */
10714 L4_MABX_B.RelationalOperator3_g = (L4_MABX_B.SPN524_TransSelectedGear ==
10715 L4_MABX_P.CPV1_Value_n);
10716
10717 /* RelationalOperator: '<S211>/Relational Operator2' incorporates:
10718 * Constant: '<S211>/CPV2'
10719 */
10720 L4_MABX_B.RelationalOperator2_f = (L4_MABX_B.SPN523_TransCurrentGear ==
10721 L4_MABX_P.CPV2_Value_h);
10722
10723 /* RelationalOperator: '<S211>/Relational Operator4' incorporates:
10724 * Constant: '<S211>/CPV5'
10725 */
10726 L4_MABX_B.RelationalOperator4_o = (L4_MABX_B.SFunction1_o2_gh ==
10727 L4_MABX_P.CPV5_Value_g);
10728
10729 /* Logic: '<S211>/Logical Operator' */
10730 L4_MABX_B.F_Ignition_sw_off_conditions_me = (L4_MABX_B.RelationalOperator1_c &&
10731 L4_MABX_B.RelationalOperator3_g && L4_MABX_B.RelationalOperator2_f &&
10732 L4_MABX_B.RelationalOperator4_o);
10733
10734 /* RelationalOperator: '<S211>/Relational Operator' incorporates:
10735 * Constant: '<S211>/IGN_SW_VOLTAGE_THRESHOLD_APV'
10736 */
10737 L4_MABX_B.F_Ignition_sw_on = (L4_MABX_B.IgnitionKeySwitch_voltage >=
10738 L4_MABX_P.IGN_SW_VOLTAGE_THRESHOLD_APV_Va);
10739
10740 /* SignalConversion: '<S218>/TmpSignal ConversionAt SFunction Inport3' incorporates:
10741 * Chart: '<S211>/Relay_control_state_machine'
10742 * Constant: '<S211>/IGN_RELAY_ON_DELAY_SECS_APV'
10743 * Constant: '<S211>/INVERTER_RELAY_ON_DELAY_SECS_APV'
10744 * Constant: '<S211>/MABX_RELAY_ON_DELAY_SECS_APV'
10745 * Constant: '<S211>/SENSOR_RELAY_ON_DELAY_SECS_APV'
10746 */
10747 L4_MABX_B.TmpSignalConversionAtSFunctionI[0] =
10748 L4_MABX_P.IGN_RELAY_ON_DELAY_SECS_APV_Val;
10749 L4_MABX_B.TmpSignalConversionAtSFunctionI[1] =
10750 L4_MABX_P.INVERTER_RELAY_ON_DELAY_SECS_AP;
10751 L4_MABX_B.TmpSignalConversionAtSFunctionI[2] =
10752 L4_MABX_P.MABX_RELAY_ON_DELAY_SECS_APV_Va;
10753 L4_MABX_B.TmpSignalConversionAtSFunctionI[3] =
10754 L4_MABX_P.SENSOR_RELAY_ON_DELAY_SECS_APV_;
10755
10756 /* SignalConversion: '<S218>/TmpSignal ConversionAt SFunction Inport4' incorporates:
10757 * Chart: '<S211>/Relay_control_state_machine'
10758 * Constant: '<S211>/IGN_RELAY_OFF_DELAY_SECS_APV'
10759 * Constant: '<S211>/INVERTER_RELAY_OFF_DELAY_SECS_APV'
10760 * Constant: '<S211>/MABX_RELAY_OFF_DELAY_SECS_APV'
10761 * Constant: '<S211>/SENSOR_RELAY_OFF_DELAY_SECS_APV'
10762 */
10763 L4_MABX_B.TmpSignalConversionAtSFunctio_k[0] =
10764 L4_MABX_P.IGN_RELAY_OFF_DELAY_SECS_APV_Va;
10765 L4_MABX_B.TmpSignalConversionAtSFunctio_k[1] =
10766 L4_MABX_P.INVERTER_RELAY_OFF_DELAY_SECS_A;
10767 L4_MABX_B.TmpSignalConversionAtSFunctio_k[2] =
10768 L4_MABX_P.MABX_RELAY_OFF_DELAY_SECS_APV_V;
10769 L4_MABX_B.TmpSignalConversionAtSFunctio_k[3] =
10770 L4_MABX_P.SENSOR_RELAY_OFF_DELAY_SECS_APV;
10771
10772 /* Chart: '<S211>/Relay_control_state_machine' */
10773 if (L4_MABX_DW.temporalCounter_i1 < MAX_uint32_T) {
10774 L4_MABX_DW.temporalCounter_i1++;
10775 }
10776
10777 /* Gateway: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */
10778 /* During: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */
10779 if (L4_MABX_DW.is_active_c6_SUB_L4_Task_10ms_S == 0U) {
10780 /* Entry: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */
10781 L4_MABX_DW.is_active_c6_SUB_L4_Task_10ms_S = 1U;
10782
10783 /* Entry Internal: STATE_CONTROL_10ms/Relay_control/Relay_control_state_machine */
10784 /* Transition: '<S218>:13' */
10785 L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_INITIAL;
10786 L4_MABX_enter_atomic_INITIAL();
10787 } else {
10788 switch (L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT) {
10789 case L4_MABX_IN_INITIAL:
10790 L4_MABX_B.F_Ignition_relay_command_i = false;
10791 L4_MABX_B.F_Inverter_relay_command_p = false;
10792 L4_MABX_B.F_MABX_relay_command_n = false;
10793 L4_MABX_B.F_Sensor_relay_command_k = false;
10794
10795 /* During 'INITIAL': '<S218>:12' */
10796 if (L4_MABX_B.F_Ignition_sw_on) {
10797 /* Transition: '<S218>:17' */
10798 L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_POWER_UP_ROUTINE;
10799
10800 /* Entry Internal 'POWER_UP_ROUTINE': '<S218>:16' */
10801 /* Transition: '<S218>:64' */
10802 L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_WAIT;
10803 L4_MABX_DW.temporalCounter_i1 = 0U;
10804 }
10805 break;
10806
10807 case L4_MABX_IN_POWER_DOWN_ROUTINE:
10808 /* During 'POWER_DOWN_ROUTINE': '<S218>:30' */
10809 switch (L4_MABX_DW.is_POWER_DOWN_ROUTINE) {
10810 case L4_MABX_IN_IGN_RELAY_UNLATCH:
10811 L4_MABX_B.F_Ignition_relay_command_i = false;
10812
10813 /* During 'IGN_RELAY_UNLATCH': '<S218>:29' */
10814 if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil
10815 (L4_MABX_DW.INVERTER_RELAY_OFF_DELAY_SECS_A * 100.0)) {
10816 /* Transition: '<S218>:23' */
10817 L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_INV_RELAY_UNLATCH;
10818 L4_MABX_DW.temporalCounter_i1 = 0U;
10819
10820 /* Entry 'INV_RELAY_UNLATCH': '<S218>:28' */
10821 L4_MABX_B.F_Inverter_relay_command_p = false;
10822 }
10823 break;
10824
10825 case L4_MABX_IN_INV_RELAY_UNLATCH:
10826 L4_MABX_B.F_Inverter_relay_command_p = false;
10827
10828 /* During 'INV_RELAY_UNLATCH': '<S218>:28' */
10829 if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil
10830 (L4_MABX_DW.SENSOR_RELAY_OFF_DELAY_SECS_APV * 100.0)) {
10831 /* Transition: '<S218>:22' */
10832 L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_SENSOR_RELAY_UNLATCH;
10833 L4_MABX_DW.temporalCounter_i1 = 0U;
10834
10835 /* Entry 'SENSOR_RELAY_UNLATCH': '<S218>:25' */
10836 L4_MABX_B.F_Sensor_relay_command_k = false;
10837 }
10838 break;
10839
10840 case L4_MABX_IN_MABX_RELAY_UNLATCH:
10841 L4_MABX_B.F_MABX_relay_command_n = false;
10842
10843 /* During 'MABX_RELAY_UNLATCH': '<S218>:27' */
10844 /* Transition: '<S218>:45' */
10845 /* Transition: '<S218>:46' */
10846 /* Transition: '<S218>:47' */
10847 /* Transition: '<S218>:48' */
10848 L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD;
10849 L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_INITIAL;
10850 L4_MABX_enter_atomic_INITIAL();
10851 break;
10852
10853 case L4_MABX_IN_SENSOR_RELAY_UNLATCH:
10854 L4_MABX_B.F_Sensor_relay_command_k = false;
10855
10856 /* During 'SENSOR_RELAY_UNLATCH': '<S218>:25' */
10857 if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil
10858 (L4_MABX_DW.MABX_RELAY_OFF_DELAY_SECS_APV * 100.0)) {
10859 /* Transition: '<S218>:26' */
10860 L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_MABX_RELAY_UNLATCH;
10861
10862 /* Entry 'MABX_RELAY_UNLATCH': '<S218>:27' */
10863 L4_MABX_B.F_MABX_relay_command_n = false;
10864 }
10865 break;
10866
10867 default:
10868 /* During 'WAIT': '<S218>:65' */
10869 if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil
10870 (L4_MABX_DW.IGN_RELAY_OFF_DELAY_SECS_APV * 100.0)) {
10871 /* Transition: '<S218>:55' */
10872 L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_IGN_RELAY_UNLATCH;
10873 L4_MABX_DW.temporalCounter_i1 = 0U;
10874
10875 /* Entry 'IGN_RELAY_UNLATCH': '<S218>:29' */
10876 L4_MABX_B.F_Ignition_relay_command_i = false;
10877 }
10878 break;
10879 }
10880 break;
10881
10882 default:
10883 /* During 'POWER_UP_ROUTINE': '<S218>:16' */
10884 zcEvent = ((!L4_MABX_B.F_Ignition_sw_on) &&
10885 L4_MABX_B.F_Ignition_sw_off_conditions_me);
10886 if (zcEvent) {
10887 /* Transition: '<S218>:31' */
10888 /* Exit Internal 'POWER_UP_ROUTINE': '<S218>:16' */
10889 L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD;
10890 L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT =
10891 L4_MABX_IN_POWER_DOWN_ROUTINE;
10892
10893 /* Entry Internal 'POWER_DOWN_ROUTINE': '<S218>:30' */
10894 /* Transition: '<S218>:66' */
10895 L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_WAIT;
10896 L4_MABX_DW.temporalCounter_i1 = 0U;
10897 } else {
10898 switch (L4_MABX_DW.is_POWER_UP_ROUTINE) {
10899 case L4_MABX_IN_IGN_RELAY_LATCH:
10900 L4_MABX_B.F_Ignition_relay_command_i = true;
10901
10902 /* During 'IGN_RELAY_LATCH': '<S218>:20' */
10903 break;
10904
10905 case L4_MABX_IN_INV_RELAY_LATCH:
10906 L4_MABX_B.F_Inverter_relay_command_p = true;
10907
10908 /* During 'INV_RELAY_LATCH': '<S218>:19' */
10909 if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil
10910 (L4_MABX_DW.IGN_RELAY_ON_DELAY_SECS_APV * 100.0)) {
10911 /* Transition: '<S218>:21' */
10912 L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_IGN_RELAY_LATCH;
10913
10914 /* Entry 'IGN_RELAY_LATCH': '<S218>:20' */
10915 L4_MABX_B.F_Ignition_relay_command_i = true;
10916 }
10917 break;
10918
10919 case L4_MABX_IN_MABX_RELAY_LATCH:
10920 L4_MABX_B.F_MABX_relay_command_n = true;
10921
10922 /* During 'MABX_RELAY_LATCH': '<S218>:10' */
10923 if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil
10924 (L4_MABX_DW.SENSOR_RELAY_ON_DELAY_SECS_APV * 100.0)) {
10925 /* Transition: '<S218>:15' */
10926 L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_SENSOR_RELAY_LATCH;
10927 L4_MABX_DW.temporalCounter_i1 = 0U;
10928
10929 /* Entry 'SENSOR_RELAY_LATCH': '<S218>:14' */
10930 L4_MABX_B.F_Sensor_relay_command_k = true;
10931 }
10932 break;
10933
10934 case L4_MABX_IN_SENSOR_RELAY_LATCH:
10935 L4_MABX_B.F_Sensor_relay_command_k = true;
10936
10937 /* During 'SENSOR_RELAY_LATCH': '<S218>:14' */
10938 if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil
10939 (L4_MABX_DW.INVERTER_RELAY_ON_DELAY_SECS_AP * 100.0)) {
10940 /* Transition: '<S218>:18' */
10941 L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_INV_RELAY_LATCH;
10942 L4_MABX_DW.temporalCounter_i1 = 0U;
10943
10944 /* Entry 'INV_RELAY_LATCH': '<S218>:19' */
10945 L4_MABX_B.F_Inverter_relay_command_p = true;
10946 }
10947 break;
10948
10949 default:
10950 /* During 'WAIT': '<S218>:63' */
10951 if (L4_MABX_DW.temporalCounter_i1 >= (uint32_T)ceil
10952 (L4_MABX_DW.MABX_RELAY_ON_DELAY_SECS_APV * 100.0)) {
10953 /* Transition: '<S218>:11' */
10954 L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_MABX_RELAY_LATCH;
10955 L4_MABX_DW.temporalCounter_i1 = 0U;
10956
10957 /* Entry 'MABX_RELAY_LATCH': '<S218>:10' */
10958 L4_MABX_B.F_MABX_relay_command_n = true;
10959 }
10960 break;
10961 }
10962 }
10963 break;
10964 }
10965 }
10966
10967 /* Lookup_n-D: '<S79>/CurveBasedSpeedSetpoint' incorporates:
10968 * Constant: '<S80>/zero'
10969 */
10970 L4_MABX_B.CurveBasedSpeedSetpoint = look1_binlcapw(L4_MABX_P.zero_Value,
10971 L4_MABX_P.CurveBasedSpeedSetpoint_bp01Dat,
10972 L4_MABX_P.CurveBasedSpeedSetpoint_tableDa, 4U);
10973
10974 /* Lookup_n-D: '<S80>/1-D Lookup Table1' */
10975 L4_MABX_B.uDLookupTable1 = look1_binlxpw(SteerWheelAngle,
10976 L4_MABX_P.uDLookupTable1_bp01Data, L4_MABX_P.uDLookupTable1_tableData, 16U);
10977
10978 /* Product: '<S285>/Divide' incorporates:
10979 * Constant: '<S277>/Constant'
10980 * Constant: '<S277>/Constant1'
10981 */
10982 L4_MABX_B.Divide_nn = (real32_T)(L4_MABX_P.Constant1_Value_i /
10983 L4_MABX_P.Constant_Value_e);
10984
10985 /* DataTypeConversion: '<S80>/Data Type Conversion5' */
10986 PositionFinalLimited = floor(L4_MABX_B.SFunction1_o2_kz);
10987 if (rtIsNaN(PositionFinalLimited) || rtIsInf(PositionFinalLimited)) {
10988 PositionFinalLimited = 0.0;
10989 } else {
10990 PositionFinalLimited = fmod(PositionFinalLimited, 256.0);
10991 }
10992
10993 L4_MABX_B.DataTypeConversion5_e = (uint8_T)(PositionFinalLimited < 0.0 ?
10994 (int32_T)(uint8_T)-(int8_T)(uint8_T)-PositionFinalLimited : (int32_T)
10995 (uint8_T)PositionFinalLimited);
10996
10997 /* End of DataTypeConversion: '<S80>/Data Type Conversion5' */
10998
10999 /* Chart: '<S283>/Chart' */
11000 /* Gateway: STEERCTRL_10ms/slew/Chart */
11001 /* During: STEERCTRL_10ms/slew/Chart */
11002 if (L4_MABX_DW.is_active_c12_SUB_L4_Task_10ms_ == 0U) {
11003 /* Entry: STEERCTRL_10ms/slew/Chart */
11004 L4_MABX_DW.is_active_c12_SUB_L4_Task_10ms_ = 1U;
11005
11006 /* Entry Internal: STEERCTRL_10ms/slew/Chart */
11007 /* Transition: '<S333>:4' */
11008 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_h;
11009
11010 /* Entry 'init': '<S333>:1' */
11011 L4_MABX_B.stateChange = 0U;
11012 } else {
11013 switch (L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE) {
11014 case L4_MABX_IN_OneLane:
11015 /* During 'OneLane': '<S333>:7' */
11016 /* Transition: '<S333>:20' */
11017 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_OneLane1;
11018
11019 /* Entry 'OneLane1': '<S333>:18' */
11020 L4_MABX_B.stateChange = 0U;
11021 break;
11022
11023 case L4_MABX_IN_OneLane1:
11024 L4_MABX_B.stateChange = 0U;
11025
11026 /* During 'OneLane1': '<S333>:18' */
11027 zcEvent = ((L4_MABX_B.DataTypeConversion5_e < 3) ||
11028 (L4_MABX_B.DataTypeConversion5_e > 18));
11029 if (zcEvent) {
11030 /* Transition: '<S333>:22' */
11031 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_h;
11032
11033 /* Entry 'init': '<S333>:1' */
11034 L4_MABX_B.stateChange = 0U;
11035 }
11036 break;
11037
11038 case L4_MABX_IN_TwoLanes:
11039 /* During 'TwoLanes': '<S333>:8' */
11040 /* Transition: '<S333>:21' */
11041 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_TwoLanes1;
11042
11043 /* Entry 'TwoLanes1': '<S333>:19' */
11044 L4_MABX_B.stateChange = 0U;
11045 break;
11046
11047 case L4_MABX_IN_TwoLanes1:
11048 L4_MABX_B.stateChange = 0U;
11049
11050 /* During 'TwoLanes1': '<S333>:19' */
11051 if (L4_MABX_B.DataTypeConversion5_e < 18) {
11052 /* Transition: '<S333>:23' */
11053 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_h;
11054
11055 /* Entry 'init': '<S333>:1' */
11056 L4_MABX_B.stateChange = 0U;
11057 }
11058 break;
11059
11060 case L4_MABX_IN_ZeroLanes:
11061 /* During 'ZeroLanes': '<S333>:5' */
11062 /* Transition: '<S333>:16' */
11063 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_ZeroLanes1;
11064
11065 /* Entry 'ZeroLanes1': '<S333>:15' */
11066 L4_MABX_B.stateChange = 0U;
11067 break;
11068
11069 case L4_MABX_IN_ZeroLanes1:
11070 L4_MABX_B.stateChange = 0U;
11071
11072 /* During 'ZeroLanes1': '<S333>:15' */
11073 if (L4_MABX_B.DataTypeConversion5_e > 3) {
11074 /* Transition: '<S333>:17' */
11075 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_init_h;
11076
11077 /* Entry 'init': '<S333>:1' */
11078 L4_MABX_B.stateChange = 0U;
11079 }
11080 break;
11081
11082 default:
11083 L4_MABX_B.stateChange = 0U;
11084
11085 /* During 'init': '<S333>:1' */
11086 if (L4_MABX_B.DataTypeConversion5_e <= 3) {
11087 /* Transition: '<S333>:6' */
11088 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_ZeroLanes;
11089
11090 /* Entry 'ZeroLanes': '<S333>:5' */
11091 L4_MABX_B.stateChange = 1U;
11092 } else if (L4_MABX_B.DataTypeConversion5_e > 18) {
11093 /* Transition: '<S333>:9' */
11094 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_TwoLanes;
11095
11096 /* Entry 'TwoLanes': '<S333>:8' */
11097 L4_MABX_B.stateChange = 1U;
11098 } else {
11099 if (L4_MABX_B.DataTypeConversion5_e > 3) {
11100 /* Transition: '<S333>:10' */
11101 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_OneLane;
11102
11103 /* Entry 'OneLane': '<S333>:7' */
11104 L4_MABX_B.stateChange = 1U;
11105 }
11106 }
11107 break;
11108 }
11109 }
11110
11111 /* End of Chart: '<S283>/Chart' */
11112
11113 /* DataTypeConversion: '<S283>/Data Type Conversion' */
11114 L4_MABX_B.DataTypeConversion_l1 = (L4_MABX_B.stateChange != 0);
11115
11116 /* UnitDelay: '<S327>/Unit_Delay1' */
11117 L4_MABX_B.Unit_Delay1_j = L4_MABX_DW.Unit_Delay1_DSTATE_db;
11118
11119 /* Logic: '<S327>/Logical Operator' incorporates:
11120 * Constant: '<S282>/zero'
11121 */
11122 L4_MABX_B.LogicalOperator_kh = (L4_MABX_P.zero_Value_g ||
11123 L4_MABX_B.Unit_Delay1_j);
11124
11125 /* MinMax: '<S327>/MinMax1' incorporates:
11126 * Constant: '<S282>/timeConstant'
11127 * Constant: '<S282>/timeConstant1'
11128 */
11129 DeltaTime = L4_MABX_P.timeConstant1_Value;
11130 PositionFinalLimited = L4_MABX_P.timeConstant_Value;
11131 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
11132 PositionFinalLimited = DeltaTime;
11133 }
11134
11135 L4_MABX_B.MinMax1_pr = PositionFinalLimited;
11136
11137 /* End of MinMax: '<S327>/MinMax1' */
11138
11139 /* Saturate: '<S327>/Saturation' */
11140 DeltaTime = L4_MABX_B.MinMax1_pr;
11141 Time56 = L4_MABX_P.Saturation_LowerSat_p2;
11142 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_o1;
11143 if (DeltaTime > PositionFinalLimited) {
11144 L4_MABX_B.Saturation_ns = PositionFinalLimited;
11145 } else if (DeltaTime < Time56) {
11146 L4_MABX_B.Saturation_ns = Time56;
11147 } else {
11148 L4_MABX_B.Saturation_ns = DeltaTime;
11149 }
11150
11151 /* End of Saturate: '<S327>/Saturation' */
11152
11153 /* Product: '<S327>/Divide' incorporates:
11154 * Constant: '<S282>/timeConstant1'
11155 */
11156 L4_MABX_B.Divide_o = L4_MABX_P.timeConstant1_Value / L4_MABX_B.Saturation_ns;
11157
11158 /* Product: '<S327>/Product2' */
11159 L4_MABX_B.Product2_bu = L4_MABX_B.SFunction1_o3_on * L4_MABX_B.Divide_o;
11160
11161 /* Sum: '<S327>/Subtract1' incorporates:
11162 * Constant: '<S327>/Constant1'
11163 */
11164 L4_MABX_B.Subtract1_ei = L4_MABX_P.Constant1_Value_n - L4_MABX_B.Divide_o;
11165
11166 /* UnitDelay: '<S327>/Unit_Delay2' */
11167 L4_MABX_B.Unit_Delay2_k = L4_MABX_DW.Unit_Delay2_DSTATE_d;
11168
11169 /* Product: '<S327>/Product1' */
11170 L4_MABX_B.Product1_n = L4_MABX_B.Subtract1_ei * L4_MABX_B.Unit_Delay2_k;
11171
11172 /* Sum: '<S327>/Add1' */
11173 L4_MABX_B.Add1_k = L4_MABX_B.Product2_bu + L4_MABX_B.Product1_n;
11174
11175 /* Outputs for Atomic SubSystem: '<S327>/If_Then_Else' */
11176 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_kh, L4_MABX_B.SFunction1_o3_on,
11177 L4_MABX_B.Add1_k, &L4_MABX_B.If_Then_Else_b3);
11178
11179 /* End of Outputs for SubSystem: '<S327>/If_Then_Else' */
11180
11181 /* Abs: '<S282>/Abs' */
11182 L4_MABX_B.Abs_i = fabs(L4_MABX_B.SFunction1_o3_on);
11183
11184 /* Sum: '<S282>/Add' */
11185 L4_MABX_B.Add_p = L4_MABX_B.Abs_i - L4_MABX_B.If_Then_Else_b3.Switch;
11186
11187 /* RelationalOperator: '<S282>/highRateOfChange' incorporates:
11188 * Constant: '<S282>/rateOfChangeThreshold'
11189 */
11190 L4_MABX_B.highRateOfChange = (L4_MABX_B.Add_p >
11191 L4_MABX_P.rateOfChangeThreshold_Value);
11192
11193 /* RelationalOperator: '<S282>/closeToEdge' incorporates:
11194 * Constant: '<S282>/closeToLaneEdgeThreshold'
11195 */
11196 L4_MABX_B.closeToEdge = (L4_MABX_B.Abs_i >
11197 L4_MABX_P.closeToLaneEdgeThreshold_Value);
11198
11199 /* Logic: '<S282>/JumpNearEdge' */
11200 L4_MABX_B.JumpNearEdge = (L4_MABX_B.highRateOfChange && L4_MABX_B.closeToEdge);
11201
11202 /* UnitDelay: '<S326>/Delay Input1' */
11203 L4_MABX_B.Uk1_k2 = L4_MABX_DW.DelayInput1_DSTATE_f0;
11204
11205 /* RelationalOperator: '<S326>/FixPt Relational Operator' */
11206 L4_MABX_B.FixPtRelationalOperator_iv = (L4_MABX_B.JumpNearEdge !=
11207 L4_MABX_B.Uk1_k2);
11208
11209 /* DataTypeConversion: '<S282>/Data Type Conversion' */
11210 L4_MABX_B.DataTypeConversion_dz = L4_MABX_B.FixPtRelationalOperator_iv;
11211
11212 /* UnitDelay: '<S328>/Unit_Delay1' */
11213 L4_MABX_B.Unit_Delay1_f = L4_MABX_DW.Unit_Delay1_DSTATE_a;
11214
11215 /* Logic: '<S328>/Logical Operator' */
11216 L4_MABX_B.LogicalOperator_a = (L4_MABX_B.DataTypeConversion_dz ||
11217 L4_MABX_B.Unit_Delay1_f);
11218
11219 /* Switch: '<S282>/Switch' incorporates:
11220 * Constant: '<S282>/correction'
11221 * Constant: '<S282>/zero1'
11222 */
11223 if (L4_MABX_B.JumpNearEdge) {
11224 L4_MABX_B.Switch_g = L4_MABX_P.correction_Value;
11225 } else {
11226 L4_MABX_B.Switch_g = L4_MABX_P.zero1_Value;
11227 }
11228
11229 /* End of Switch: '<S282>/Switch' */
11230
11231 /* MinMax: '<S328>/MinMax1' incorporates:
11232 * Constant: '<S282>/timeConstant2'
11233 * Constant: '<S282>/timeConstant3'
11234 */
11235 DeltaTime = L4_MABX_P.timeConstant3_Value;
11236 PositionFinalLimited = L4_MABX_P.timeConstant2_Value;
11237 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
11238 PositionFinalLimited = DeltaTime;
11239 }
11240
11241 L4_MABX_B.MinMax1_a = PositionFinalLimited;
11242
11243 /* End of MinMax: '<S328>/MinMax1' */
11244
11245 /* Saturate: '<S328>/Saturation' */
11246 DeltaTime = L4_MABX_B.MinMax1_a;
11247 Time56 = L4_MABX_P.Saturation_LowerSat_ph;
11248 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_d;
11249 if (DeltaTime > PositionFinalLimited) {
11250 L4_MABX_B.Saturation_e = PositionFinalLimited;
11251 } else if (DeltaTime < Time56) {
11252 L4_MABX_B.Saturation_e = Time56;
11253 } else {
11254 L4_MABX_B.Saturation_e = DeltaTime;
11255 }
11256
11257 /* End of Saturate: '<S328>/Saturation' */
11258
11259 /* Product: '<S328>/Divide' incorporates:
11260 * Constant: '<S282>/timeConstant3'
11261 */
11262 L4_MABX_B.Divide_d = L4_MABX_P.timeConstant3_Value / L4_MABX_B.Saturation_e;
11263
11264 /* Product: '<S328>/Product2' */
11265 L4_MABX_B.Product2_f = L4_MABX_B.Switch_g * L4_MABX_B.Divide_d;
11266
11267 /* Sum: '<S328>/Subtract1' incorporates:
11268 * Constant: '<S328>/Constant1'
11269 */
11270 L4_MABX_B.Subtract1_b = L4_MABX_P.Constant1_Value_j - L4_MABX_B.Divide_d;
11271
11272 /* UnitDelay: '<S328>/Unit_Delay2' */
11273 L4_MABX_B.Unit_Delay2_l = L4_MABX_DW.Unit_Delay2_DSTATE_i;
11274
11275 /* Product: '<S328>/Product1' */
11276 L4_MABX_B.Product1_co = L4_MABX_B.Subtract1_b * L4_MABX_B.Unit_Delay2_l;
11277
11278 /* Sum: '<S328>/Add1' */
11279 L4_MABX_B.Add1_p = L4_MABX_B.Product2_f + L4_MABX_B.Product1_co;
11280
11281 /* Outputs for Atomic SubSystem: '<S328>/If_Then_Else' */
11282
11283 /* Constant: '<S282>/zero2' */
11284 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_a, L4_MABX_P.zero2_Value,
11285 L4_MABX_B.Add1_p, &L4_MABX_B.If_Then_Else_mk);
11286
11287 /* End of Outputs for SubSystem: '<S328>/If_Then_Else' */
11288
11289 /* Signum: '<S282>/Sign' */
11290 PositionFinalLimited = L4_MABX_B.SFunction1_o3_on;
11291 if (PositionFinalLimited < 0.0) {
11292 L4_MABX_B.Sign = -1.0;
11293 } else if (PositionFinalLimited > 0.0) {
11294 L4_MABX_B.Sign = 1.0;
11295 } else if (PositionFinalLimited == 0.0) {
11296 L4_MABX_B.Sign = 0.0;
11297 } else {
11298 L4_MABX_B.Sign = (rtNaN);
11299 }
11300
11301 /* End of Signum: '<S282>/Sign' */
11302
11303 /* Product: '<S282>/Product' */
11304 L4_MABX_B.Product_cf = L4_MABX_B.If_Then_Else_mk.Switch * L4_MABX_B.Sign;
11305
11306 /* UnitDelay: '<S329>/Unit_Delay1' */
11307 L4_MABX_B.Unit_Delay1_d = L4_MABX_DW.Unit_Delay1_DSTATE_p3;
11308
11309 /* Logic: '<S329>/Logical Operator' incorporates:
11310 * Constant: '<S282>/zero3'
11311 */
11312 L4_MABX_B.LogicalOperator_nz = (L4_MABX_P.zero3_Value ||
11313 L4_MABX_B.Unit_Delay1_d);
11314
11315 /* MinMax: '<S329>/MinMax1' incorporates:
11316 * Constant: '<S282>/timeConstant4'
11317 * Constant: '<S282>/timeConstant5'
11318 */
11319 DeltaTime = L4_MABX_P.timeConstant5_Value;
11320 PositionFinalLimited = L4_MABX_P.timeConstant4_Value;
11321 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
11322 PositionFinalLimited = DeltaTime;
11323 }
11324
11325 L4_MABX_B.MinMax1_e = PositionFinalLimited;
11326
11327 /* End of MinMax: '<S329>/MinMax1' */
11328
11329 /* Saturate: '<S329>/Saturation' */
11330 DeltaTime = L4_MABX_B.MinMax1_e;
11331 Time56 = L4_MABX_P.Saturation_LowerSat_k;
11332 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_ok;
11333 if (DeltaTime > PositionFinalLimited) {
11334 L4_MABX_B.Saturation_o = PositionFinalLimited;
11335 } else if (DeltaTime < Time56) {
11336 L4_MABX_B.Saturation_o = Time56;
11337 } else {
11338 L4_MABX_B.Saturation_o = DeltaTime;
11339 }
11340
11341 /* End of Saturate: '<S329>/Saturation' */
11342
11343 /* Product: '<S329>/Divide' incorporates:
11344 * Constant: '<S282>/timeConstant5'
11345 */
11346 L4_MABX_B.Divide_j = L4_MABX_P.timeConstant5_Value / L4_MABX_B.Saturation_o;
11347
11348 /* Product: '<S329>/Product2' */
11349 L4_MABX_B.Product2_nk = L4_MABX_B.SFunction1_o3_on * L4_MABX_B.Divide_j;
11350
11351 /* Sum: '<S329>/Subtract1' incorporates:
11352 * Constant: '<S329>/Constant1'
11353 */
11354 L4_MABX_B.Subtract1_eh = L4_MABX_P.Constant1_Value_oi - L4_MABX_B.Divide_j;
11355
11356 /* UnitDelay: '<S329>/Unit_Delay2' */
11357 L4_MABX_B.Unit_Delay2_c = L4_MABX_DW.Unit_Delay2_DSTATE_p;
11358
11359 /* Product: '<S329>/Product1' */
11360 L4_MABX_B.Product1_cc = L4_MABX_B.Subtract1_eh * L4_MABX_B.Unit_Delay2_c;
11361
11362 /* Sum: '<S329>/Add1' */
11363 L4_MABX_B.Add1_f = L4_MABX_B.Product2_nk + L4_MABX_B.Product1_cc;
11364
11365 /* Outputs for Atomic SubSystem: '<S329>/If_Then_Else' */
11366 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_nz, L4_MABX_B.SFunction1_o3_on,
11367 L4_MABX_B.Add1_f, &L4_MABX_B.If_Then_Else_lh);
11368
11369 /* End of Outputs for SubSystem: '<S329>/If_Then_Else' */
11370
11371 /* Switch: '<S282>/Switch1' */
11372 if (L4_MABX_B.JumpNearEdge) {
11373 L4_MABX_B.Switch1_f = L4_MABX_B.If_Then_Else_lh.Switch;
11374 } else {
11375 L4_MABX_B.Switch1_f = L4_MABX_B.SFunction1_o3_on;
11376 }
11377
11378 /* End of Switch: '<S282>/Switch1' */
11379
11380 /* Sum: '<S282>/corrected Error' */
11381 L4_MABX_B.correctedError = L4_MABX_B.Product_cf + L4_MABX_B.Switch1_f;
11382
11383 /* RelationalOperator: '<S283>/Relational Operator' incorporates:
11384 * Constant: '<S283>/Constant'
11385 */
11386 L4_MABX_B.RelationalOperator_l5 = (L4_MABX_B.DataTypeConversion5_e >=
11387 L4_MABX_P.Constant_Value_mg);
11388
11389 /* Switch: '<S283>/Switch' incorporates:
11390 * Constant: '<S283>/Constant1'
11391 */
11392 if (L4_MABX_B.RelationalOperator_l5) {
11393 L4_MABX_B.Switch_h = L4_MABX_B.correctedError;
11394 } else {
11395 L4_MABX_B.Switch_h = L4_MABX_P.Constant1_Value_l;
11396 }
11397
11398 /* End of Switch: '<S283>/Switch' */
11399
11400 /* Outputs for Enabled SubSystem: '<S283>/Slew_at_event' incorporates:
11401 * EnablePort: '<S334>/Enable'
11402 */
11403 /* Constant: '<S283>/enable' */
11404 if (L4_MABX_P.enable_Value > 0.0) {
11405 if (!L4_MABX_DW.Slew_at_event_MODE_d) {
11406 /* InitializeConditions for UnitDelay: '<S336>/Unit_Delay' */
11407 L4_MABX_DW.Unit_Delay_DSTATE_bd = L4_MABX_P.Unit_Delay_InitialCondition_ls;
11408
11409 /* InitializeConditions for UnitDelay: '<S337>/Unit_Delay' */
11410 L4_MABX_DW.Unit_Delay_DSTATE_jt = L4_MABX_P.Unit_Delay_InitialCondition_i0;
11411
11412 /* InitializeConditions for UnitDelay: '<S340>/FixPt Unit Delay2' */
11413 L4_MABX_DW.FixPtUnitDelay2_DSTATE_j =
11414 L4_MABX_P.FixPtUnitDelay2_InitialCondit_c;
11415
11416 /* InitializeConditions for UnitDelay: '<S340>/FixPt Unit Delay1' */
11417 L4_MABX_DW.FixPtUnitDelay1_DSTATE_ov =
11418 L4_MABX_P.FixPtUnitDelay1_InitialCondit_f;
11419
11420 /* InitializeConditions for UnitDelay: '<S335>/Unit_Delay' */
11421 L4_MABX_DW.Unit_Delay_DSTATE_ll = L4_MABX_P.Unit_Delay_InitialCondition_ld;
11422 L4_MABX_DW.Slew_at_event_MODE_d = true;
11423 }
11424
11425 /* UnitDelay: '<S336>/Unit_Delay' */
11426 L4_MABX_B.Unit_Delay_o3 = L4_MABX_DW.Unit_Delay_DSTATE_bd;
11427
11428 /* Logic: '<S336>/Logical Operator1' */
11429 L4_MABX_B.LogicalOperator1_gw = !L4_MABX_B.Unit_Delay_o3;
11430
11431 /* Logic: '<S336>/Logical Operator' */
11432 L4_MABX_B.LogicalOperator_d2 = (L4_MABX_B.DataTypeConversion_l1 &&
11433 L4_MABX_B.LogicalOperator1_gw);
11434
11435 /* UnitDelay: '<S337>/Unit_Delay' */
11436 L4_MABX_B.Unit_Delay_hj = L4_MABX_DW.Unit_Delay_DSTATE_jt;
11437
11438 /* Logic: '<S337>/Logical Operator1' */
11439 L4_MABX_B.LogicalOperator1_hp = (L4_MABX_B.LogicalOperator_d2 ||
11440 L4_MABX_B.Unit_Delay_hj);
11441
11442 /* UnitDelay: '<S340>/FixPt Unit Delay2' */
11443 L4_MABX_B.FixPtUnitDelay2_h5 = L4_MABX_DW.FixPtUnitDelay2_DSTATE_j;
11444
11445 /* UnitDelay: '<S340>/FixPt Unit Delay1' */
11446 L4_MABX_B.Xold_gn = L4_MABX_DW.FixPtUnitDelay1_DSTATE_ov;
11447
11448 /* Switch: '<S340>/Init' */
11449 if (L4_MABX_B.FixPtUnitDelay2_h5 != 0) {
11450 L4_MABX_B.Init_jw = L4_MABX_B.Switch_h;
11451 } else {
11452 L4_MABX_B.Init_jw = L4_MABX_B.Xold_gn;
11453 }
11454
11455 /* End of Switch: '<S340>/Init' */
11456
11457 /* Abs: '<S337>/Abs' incorporates:
11458 * Constant: '<S283>/Constant3'
11459 */
11460 L4_MABX_B.Abs_a = fabs(L4_MABX_P.Constant3_Value_j);
11461
11462 /* Product: '<S337>/Product1' incorporates:
11463 * Constant: '<S283>/Constant2'
11464 */
11465 L4_MABX_B.Product1_i3 = L4_MABX_B.Abs_a * L4_MABX_P.Constant2_Value_p;
11466
11467 /* Sum: '<S337>/Add1' */
11468 L4_MABX_B.Add1_b0 = L4_MABX_B.Init_jw + L4_MABX_B.Product1_i3;
11469
11470 /* MinMax: '<S337>/MinMax2' */
11471 DeltaTime = L4_MABX_B.Switch_h;
11472 PositionFinalLimited = L4_MABX_B.Add1_b0;
11473 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
11474 PositionFinalLimited = DeltaTime;
11475 }
11476
11477 L4_MABX_B.MinMax2_l = PositionFinalLimited;
11478
11479 /* End of MinMax: '<S337>/MinMax2' */
11480
11481 /* Abs: '<S337>/Abs1' incorporates:
11482 * Constant: '<S283>/Constant4'
11483 */
11484 L4_MABX_B.Abs1_e = fabs(L4_MABX_P.Constant4_Value_bq);
11485
11486 /* Product: '<S337>/Product2' incorporates:
11487 * Constant: '<S283>/Constant2'
11488 */
11489 L4_MABX_B.Product2_k = L4_MABX_P.Constant2_Value_p * L4_MABX_B.Abs1_e;
11490
11491 /* Sum: '<S337>/Subtract1' */
11492 L4_MABX_B.Subtract1_g = L4_MABX_B.Init_jw - L4_MABX_B.Product2_k;
11493
11494 /* MinMax: '<S337>/MinMax1' */
11495 DeltaTime = L4_MABX_B.MinMax2_l;
11496 PositionFinalLimited = L4_MABX_B.Subtract1_g;
11497 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
11498 PositionFinalLimited = DeltaTime;
11499 }
11500
11501 L4_MABX_B.MinMax1_k = PositionFinalLimited;
11502
11503 /* End of MinMax: '<S337>/MinMax1' */
11504
11505 /* Outputs for Atomic SubSystem: '<S337>/If_Then_Else' */
11506 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator1_hp, L4_MABX_B.Switch_h,
11507 L4_MABX_B.MinMax1_k, &L4_MABX_B.If_Then_Else_n3);
11508
11509 /* End of Outputs for SubSystem: '<S337>/If_Then_Else' */
11510
11511 /* Sum: '<S334>/Subtract' */
11512 L4_MABX_B.Subtract_ij = L4_MABX_B.Switch_h -
11513 L4_MABX_B.If_Then_Else_n3.Switch;
11514
11515 /* Abs: '<S334>/Abs' */
11516 L4_MABX_B.Abs_eu = fabs(L4_MABX_B.Subtract_ij);
11517
11518 /* RelationalOperator: '<S334>/Relational Operator1' incorporates:
11519 * Constant: '<S334>/Constant1'
11520 */
11521 L4_MABX_B.RelationalOperator1_e = (L4_MABX_B.Abs_eu <=
11522 L4_MABX_P.Constant1_Value_ah);
11523
11524 /* Logic: '<S335>/Logical Operator3' */
11525 L4_MABX_B.LogicalOperator3_a = !L4_MABX_B.RelationalOperator1_e;
11526
11527 /* UnitDelay: '<S335>/Unit_Delay' */
11528 L4_MABX_B.Unit_Delay_ig = L4_MABX_DW.Unit_Delay_DSTATE_ll;
11529
11530 /* Logic: '<S335>/Logical Operator1' */
11531 L4_MABX_B.LogicalOperator1_joh = (L4_MABX_B.DataTypeConversion_l1 ||
11532 L4_MABX_B.Unit_Delay_ig);
11533
11534 /* Logic: '<S335>/Logical Operator' */
11535 L4_MABX_B.LogicalOperator_dm = (L4_MABX_B.LogicalOperator3_a &&
11536 L4_MABX_B.LogicalOperator1_joh);
11537
11538 /* Logic: '<S335>/Logical Operator2' */
11539 L4_MABX_B.LogicalOperator2_j = !L4_MABX_B.LogicalOperator_dm;
11540
11541 /* RelationalOperator: '<S338>/min_relop' incorporates:
11542 * Constant: '<S283>/Constant3'
11543 * Constant: '<S338>/min_val'
11544 */
11545 L4_MABX_B.min_relop_d = (L4_MABX_P.CheckStaticLowerBound_min_n <=
11546 L4_MABX_P.Constant3_Value_j);
11547
11548 /* Assertion: '<S338>/Assertion' */
11549 utAssert(L4_MABX_B.min_relop_d);
11550 } else {
11551 if (L4_MABX_DW.Slew_at_event_MODE_d) {
11552 /* Disable for Outport: '<S334>/F_Out_slewing' */
11553 L4_MABX_B.LogicalOperator_dm = L4_MABX_P.F_Out_slewing_Y0;
11554
11555 /* Disable for Outport: '<S334>/Out' */
11556 L4_MABX_B.If_Then_Else_n3.Switch = L4_MABX_P.Out_Y0;
11557 L4_MABX_DW.Slew_at_event_MODE_d = false;
11558 }
11559 }
11560
11561 /* End of Constant: '<S283>/enable' */
11562 /* End of Outputs for SubSystem: '<S283>/Slew_at_event' */
11563
11564 /* Switch: '<S283>/Switch1' incorporates:
11565 * Constant: '<S283>/enableSlew'
11566 */
11567 if (L4_MABX_P.enableSlew_Value != 0.0) {
11568 L4_MABX_B.Switch1_j = L4_MABX_B.If_Then_Else_n3.Switch;
11569 } else {
11570 L4_MABX_B.Switch1_j = L4_MABX_B.Switch_h;
11571 }
11572
11573 /* End of Switch: '<S283>/Switch1' */
11574
11575 /* Gain: '<S80>/sign' */
11576 L4_MABX_B.SteerCtrlErrRaw = L4_MABX_P.sign_Gain * L4_MABX_B.Switch1_j;
11577
11578 /* DataTypeConversion: '<S80>/Data Type Conversion1' */
11579 L4_MABX_B.DataTypeConversion1_ev = L4_MABX_B.SteerCtrlErrRaw;
11580
11581 /* UnitDelay: '<S285>/Unit Delay' */
11582 L4_MABX_B.UnitDelay_fm = L4_MABX_DW.UnitDelay_DSTATE_d;
11583
11584 /* Switch: '<S289>/Switch1' incorporates:
11585 * Constant: '<S285>/E'
11586 * Constant: '<S285>/R'
11587 * Switch: '<S287>/Switch1'
11588 */
11589 if (L4_MABX_P.R_Value) {
11590 /* DataTypeConversion: '<S285>/Data Type Conversion1' incorporates:
11591 * Constant: '<S285>/IV'
11592 */
11593 L4_MABX_B.DataTypeConversion1_b1 = (real32_T)L4_MABX_P.IV_Value;
11594 L4_MABX_B.Switch1_fi = L4_MABX_B.DataTypeConversion1_b1;
11595 } else {
11596 if (L4_MABX_P.E_Value_j) {
11597 /* DataTypeConversion: '<S285>/Data Type Conversion' incorporates:
11598 * Switch: '<S287>/Switch1'
11599 */
11600 L4_MABX_B.DataTypeConversion_ps = (real32_T)
11601 L4_MABX_B.DataTypeConversion1_ev;
11602
11603 /* Sum: '<S285>/Add3' incorporates:
11604 * Switch: '<S287>/Switch1'
11605 */
11606 L4_MABX_B.Add3_j = L4_MABX_B.DataTypeConversion_ps -
11607 L4_MABX_B.UnitDelay_fm;
11608
11609 /* Product: '<S285>/Product1' incorporates:
11610 * Switch: '<S287>/Switch1'
11611 */
11612 L4_MABX_B.Product1_n2 = L4_MABX_B.Divide_nn * L4_MABX_B.Add3_j;
11613
11614 /* Sum: '<S285>/Add' incorporates:
11615 * Switch: '<S287>/Switch1'
11616 */
11617 L4_MABX_B.Add_f = L4_MABX_B.Product1_n2 + L4_MABX_B.UnitDelay_fm;
11618
11619 /* Switch: '<S287>/Switch1' */
11620 L4_MABX_B.Switch1_cw = L4_MABX_B.Add_f;
11621 } else {
11622 /* Switch: '<S287>/Switch1' */
11623 L4_MABX_B.Switch1_cw = L4_MABX_B.UnitDelay_fm;
11624 }
11625
11626 L4_MABX_B.Switch1_fi = L4_MABX_B.Switch1_cw;
11627 }
11628
11629 /* End of Switch: '<S289>/Switch1' */
11630
11631 /* DataTypeConversion: '<S286>/Conversion' */
11632 L4_MABX_B.Conversion = L4_MABX_B.Switch1_fi;
11633
11634 /* Abs: '<S80>/Abs' */
11635 L4_MABX_B.Abs_d = fabs(L4_MABX_B.Conversion);
11636
11637 /* Lookup_n-D: '<S80>/SteeringControlPGainErrorBased' */
11638 L4_MABX_B.SteeringControlPGainErrorBased = look1_binlxpw(L4_MABX_B.Abs_d,
11639 L4_MABX_P.SteeringControlPGainErrorBase_n,
11640 L4_MABX_P.SteeringControlPGainErrorBased_, 9U);
11641
11642 /* DataTypeConversion: '<S80>/Data Type Conversion' */
11643 L4_MABX_B.DataTypeConversion_ku = L4_MABX_B.SFunction1_o1_ie;
11644
11645 /* Lookup_n-D: '<S80>/SteeringControlPGainSpeedFactor' */
11646 L4_MABX_B.SteeringControlPGainSpeedFactor = look1_binlxpw
11647 (L4_MABX_B.DataTypeConversion_ku, L4_MABX_P.SteeringControlPGainSpeedFact_i,
11648 L4_MABX_P.SteeringControlPGainSpeedFactor, 8U);
11649
11650 /* Product: '<S80>/Product1' */
11651 L4_MABX_B.SteerCtrlPgain = L4_MABX_B.SteeringControlPGainErrorBased *
11652 L4_MABX_B.SteeringControlPGainSpeedFactor;
11653
11654 /* Gain: '<S80>/Gain' */
11655 L4_MABX_B.Gain_cd = L4_MABX_P.Gain_Gain_m * L4_MABX_B.SteerCtrlPgain;
11656
11657 /* Product: '<S296>/Product' */
11658 L4_MABX_B.Product_d = L4_MABX_B.Conversion * L4_MABX_B.Gain_cd;
11659
11660 /* Product: '<S296>/Divide' incorporates:
11661 * Constant: '<S279>/Constant21'
11662 * Constant: '<S279>/SteeringControlIntGain'
11663 */
11664 L4_MABX_B.Divide_ag = L4_MABX_P.Constant21_Value /
11665 L4_MABX_P.SteeringControlIntGain_Value;
11666
11667 /* Product: '<S296>/Product1' */
11668 L4_MABX_B.Product1_hr = L4_MABX_B.Product_d * L4_MABX_B.Divide_ag;
11669
11670 /* UnitDelay: '<S295>/Unit Delay' */
11671 L4_MABX_B.UnitDelay_m5 = L4_MABX_DW.UnitDelay_DSTATE_ml;
11672
11673 /* RelationalOperator: '<S295>/Relational Operator' incorporates:
11674 * Constant: '<S279>/Constant19'
11675 */
11676 L4_MABX_B.RelationalOperator_d = (L4_MABX_B.UnitDelay_m5 >=
11677 L4_MABX_P.Constant19_Value);
11678
11679 /* Switch: '<S295>/Switch' incorporates:
11680 * Constant: '<S295>/Constant3'
11681 */
11682 if (L4_MABX_B.RelationalOperator_d) {
11683 L4_MABX_B.Switch_o = L4_MABX_P.Constant3_Value_pw;
11684 } else {
11685 /* RelationalOperator: '<S295>/Relational Operator1' incorporates:
11686 * Constant: '<S279>/Constant20'
11687 */
11688 L4_MABX_B.RelationalOperator1_mf = (L4_MABX_B.UnitDelay_m5 <=
11689 L4_MABX_P.Constant20_Value);
11690
11691 /* Switch: '<S295>/Switch1' incorporates:
11692 * Constant: '<S295>/Constant'
11693 * Constant: '<S295>/Constant2'
11694 */
11695 if (L4_MABX_B.RelationalOperator1_mf) {
11696 L4_MABX_B.Switch1_m = L4_MABX_P.Constant2_Value_hu;
11697 } else {
11698 L4_MABX_B.Switch1_m = L4_MABX_P.Constant_Value_i;
11699 }
11700
11701 /* End of Switch: '<S295>/Switch1' */
11702 L4_MABX_B.Switch_o = L4_MABX_B.Switch1_m;
11703 }
11704
11705 /* End of Switch: '<S295>/Switch' */
11706
11707 /* RelationalOperator: '<S298>/Relational Operator5' incorporates:
11708 * Constant: '<S298>/Constant5'
11709 */
11710 L4_MABX_B.RelationalOperator5_f = (L4_MABX_B.Switch_o !=
11711 L4_MABX_P.Constant5_Value_o);
11712
11713 /* Signum: '<S298>/Sign1' */
11714 PositionFinalLimited = L4_MABX_B.Product1_hr;
11715 if (PositionFinalLimited < 0.0) {
11716 L4_MABX_B.Sign1 = -1.0;
11717 } else if (PositionFinalLimited > 0.0) {
11718 L4_MABX_B.Sign1 = 1.0;
11719 } else if (PositionFinalLimited == 0.0) {
11720 L4_MABX_B.Sign1 = 0.0;
11721 } else {
11722 L4_MABX_B.Sign1 = (rtNaN);
11723 }
11724
11725 /* End of Signum: '<S298>/Sign1' */
11726
11727 /* RelationalOperator: '<S298>/Relational Operator4' incorporates:
11728 * Constant: '<S298>/Constant4'
11729 */
11730 L4_MABX_B.RelationalOperator4_la = (L4_MABX_P.Constant4_Value_j ==
11731 L4_MABX_B.Sign1);
11732
11733 /* RelationalOperator: '<S298>/Relational Operator2' incorporates:
11734 * Constant: '<S298>/Constant2'
11735 */
11736 L4_MABX_B.RelationalOperator2_o = (L4_MABX_B.Switch_o !=
11737 L4_MABX_P.Constant2_Value_g);
11738
11739 /* Logic: '<S298>/Logical Operator1' */
11740 L4_MABX_B.LogicalOperator1_ji = (L4_MABX_B.RelationalOperator4_la &&
11741 L4_MABX_B.RelationalOperator2_o);
11742
11743 /* RelationalOperator: '<S298>/Relational Operator1' incorporates:
11744 * Constant: '<S298>/Constant1'
11745 */
11746 L4_MABX_B.RelationalOperator1_ie = (L4_MABX_B.Switch_o !=
11747 L4_MABX_P.Constant1_Value_ly);
11748
11749 /* RelationalOperator: '<S298>/Relational Operator3' incorporates:
11750 * Constant: '<S298>/Constant3'
11751 */
11752 L4_MABX_B.RelationalOperator3_p = (L4_MABX_P.Constant3_Value_g ==
11753 L4_MABX_B.Sign1);
11754
11755 /* Logic: '<S298>/Logical Operator2' */
11756 L4_MABX_B.LogicalOperator2_oh = (L4_MABX_B.RelationalOperator1_ie &&
11757 L4_MABX_B.RelationalOperator3_p);
11758
11759 /* Logic: '<S298>/Logical Operator' */
11760 L4_MABX_B.LogicalOperator_bs = (L4_MABX_B.LogicalOperator1_ji ||
11761 L4_MABX_B.LogicalOperator2_oh);
11762
11763 /* Logic: '<S298>/Logical Operator3' */
11764 L4_MABX_B.LogicalOperator3_oi = (L4_MABX_B.RelationalOperator5_f &&
11765 L4_MABX_B.LogicalOperator_bs);
11766
11767 /* Switch: '<S298>/Switch1' incorporates:
11768 * Constant: '<S298>/Constant'
11769 */
11770 if (L4_MABX_B.LogicalOperator3_oi) {
11771 L4_MABX_B.Switch1_jw = L4_MABX_B.Product1_hr;
11772 } else {
11773 L4_MABX_B.Switch1_jw = L4_MABX_P.Constant_Value_o;
11774 }
11775
11776 /* End of Switch: '<S298>/Switch1' */
11777
11778 /* UnitDelay: '<S296>/Unit Delay' */
11779 L4_MABX_B.UnitDelay_o = L4_MABX_DW.UnitDelay_DSTATE_m0;
11780
11781 /* Sum: '<S296>/Add' */
11782 L4_MABX_B.Add_px = L4_MABX_B.Switch1_jw + L4_MABX_B.UnitDelay_o;
11783
11784 /* Product: '<S296>/Divide1' incorporates:
11785 * Constant: '<S279>/Constant21'
11786 * Constant: '<S279>/SteeringControlDGain'
11787 */
11788 L4_MABX_B.Divide1_b = L4_MABX_P.SteeringControlDGain_Value *
11789 L4_MABX_B.Product_d / L4_MABX_P.Constant21_Value;
11790
11791 /* UnitDelay: '<S296>/Unit Delay1' */
11792 L4_MABX_B.UnitDelay1_e = L4_MABX_DW.UnitDelay1_DSTATE_k;
11793
11794 /* Sum: '<S296>/Add3' */
11795 L4_MABX_B.Add3 = L4_MABX_B.Divide1_b - L4_MABX_B.UnitDelay1_e;
11796
11797 /* Sum: '<S296>/Add1' */
11798 L4_MABX_B.Add1_m = (L4_MABX_B.Product_d + L4_MABX_B.Add_px) + L4_MABX_B.Add3;
11799
11800 /* RelationalOperator: '<S297>/LowerRelop1' incorporates:
11801 * Constant: '<S279>/Constant19'
11802 */
11803 L4_MABX_B.LowerRelop1 = (L4_MABX_B.Add1_m > L4_MABX_P.Constant19_Value);
11804
11805 /* RelationalOperator: '<S297>/UpperRelop' incorporates:
11806 * Constant: '<S279>/Constant20'
11807 */
11808 L4_MABX_B.UpperRelop = (L4_MABX_B.Add1_m < L4_MABX_P.Constant20_Value);
11809
11810 /* Switch: '<S297>/Switch' incorporates:
11811 * Constant: '<S279>/Constant20'
11812 */
11813 if (L4_MABX_B.UpperRelop) {
11814 L4_MABX_B.Switch_p = L4_MABX_P.Constant20_Value;
11815 } else {
11816 L4_MABX_B.Switch_p = L4_MABX_B.Add1_m;
11817 }
11818
11819 /* End of Switch: '<S297>/Switch' */
11820
11821 /* Switch: '<S297>/Switch2' incorporates:
11822 * Constant: '<S279>/Constant19'
11823 */
11824 if (L4_MABX_B.LowerRelop1) {
11825 L4_MABX_B.Switch2_i = L4_MABX_P.Constant19_Value;
11826 } else {
11827 L4_MABX_B.Switch2_i = L4_MABX_B.Switch_p;
11828 }
11829
11830 /* End of Switch: '<S297>/Switch2' */
11831
11832 /* RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' */
11833 if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) {
11834 L4_MABX_B.previewSteeringAngle_b =
11835 L4_MABX_DW.TmpRTBAtrad2deg1Inport1_Buffer0;
11836 }
11837
11838 /* Gain: '<S80>/rad2deg1' */
11839 L4_MABX_B.rad2deg1 = L4_MABX_P.rad2deg1_Gain *
11840 L4_MABX_B.previewSteeringAngle_b;
11841
11842 /* Sum: '<S80>/Add2' incorporates:
11843 * Constant: '<S80>/steeringOffset'
11844 */
11845 L4_MABX_B.Add2 = (L4_MABX_B.rad2deg1 + L4_MABX_B.Switch2_i) +
11846 L4_MABX_P.steeringOffset_Value;
11847
11848 /* Lookup_n-D: '<S284>/1-D Lookup Table' */
11849 L4_MABX_B.uDLookupTable_a = look1_binlxpw(L4_MABX_B.DataTypeConversion_ku,
11850 L4_MABX_P.uDLookupTable_bp01Data_kj, L4_MABX_P.uDLookupTable_tableData_b, 8U);
11851
11852 /* Product: '<S284>/AdjustedStanleyGain' incorporates:
11853 * Constant: '<S284>/stanleySteeringControlGain'
11854 */
11855 L4_MABX_B.AdjustedStanleyGain = L4_MABX_B.uDLookupTable_a *
11856 L4_MABX_P.stanleySteeringControlGain_Valu;
11857
11858 /* Step: '<S278>/Step' */
11859 PositionFinalLimited = L4_MABX_M->Timing.t[0];
11860 if (PositionFinalLimited < L4_MABX_P.Step_Time) {
11861 L4_MABX_B.Step = L4_MABX_P.Step_Y0;
11862 } else {
11863 L4_MABX_B.Step = L4_MABX_P.Step_YFinal;
11864 }
11865
11866 /* End of Step: '<S278>/Step' */
11867
11868 /* DataTypeConversion: '<S278>/Data Type Conversion' */
11869 L4_MABX_B.DataTypeConversion_dn = (L4_MABX_B.Step != 0.0);
11870
11871 /* Product: '<S290>/Divide' incorporates:
11872 * Constant: '<S278>/Constant'
11873 * Constant: '<S278>/Constant1'
11874 */
11875 L4_MABX_B.Divide_d0 = (real32_T)(L4_MABX_P.Constant1_Value_iy /
11876 L4_MABX_P.Constant_Value_d);
11877
11878 /* RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' */
11879 if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) {
11880 L4_MABX_B.TmpRTBAtsignCurveOffsetInport1 =
11881 L4_MABX_DW.TmpRTBAtsignCurveOffsetInport1_;
11882 }
11883
11884 /* Gain: '<S80>/signCurveOffset' */
11885 L4_MABX_B.signCurveOffset = L4_MABX_P.signCurveOffset_Gain *
11886 L4_MABX_B.TmpRTBAtsignCurveOffsetInport1;
11887
11888 /* UnitDelay: '<S290>/Unit Delay' */
11889 L4_MABX_B.UnitDelay_lj = L4_MABX_DW.UnitDelay_DSTATE_m1;
11890
11891 /* Switch: '<S294>/Switch1' incorporates:
11892 * Constant: '<S290>/E'
11893 * Switch: '<S292>/Switch1'
11894 */
11895 if (L4_MABX_B.DataTypeConversion_dn) {
11896 /* DataTypeConversion: '<S290>/Data Type Conversion1' incorporates:
11897 * Constant: '<S290>/IV'
11898 */
11899 L4_MABX_B.DataTypeConversion1_g = (real32_T)L4_MABX_P.IV_Value_o;
11900 L4_MABX_B.Switch1_pb = L4_MABX_B.DataTypeConversion1_g;
11901 } else {
11902 if (L4_MABX_P.E_Value_ct) {
11903 /* DataTypeConversion: '<S290>/Data Type Conversion' incorporates:
11904 * Switch: '<S292>/Switch1'
11905 */
11906 L4_MABX_B.DataTypeConversion_mv = (real32_T)L4_MABX_B.signCurveOffset;
11907
11908 /* Sum: '<S290>/Add3' incorporates:
11909 * Switch: '<S292>/Switch1'
11910 */
11911 L4_MABX_B.Add3_p = L4_MABX_B.DataTypeConversion_mv -
11912 L4_MABX_B.UnitDelay_lj;
11913
11914 /* Product: '<S290>/Product1' incorporates:
11915 * Switch: '<S292>/Switch1'
11916 */
11917 L4_MABX_B.Product1_ce = L4_MABX_B.Divide_d0 * L4_MABX_B.Add3_p;
11918
11919 /* Sum: '<S290>/Add' incorporates:
11920 * Switch: '<S292>/Switch1'
11921 */
11922 L4_MABX_B.Add_a = L4_MABX_B.Product1_ce + L4_MABX_B.UnitDelay_lj;
11923
11924 /* Switch: '<S292>/Switch1' */
11925 L4_MABX_B.Switch1_aq = L4_MABX_B.Add_a;
11926 } else {
11927 /* Switch: '<S292>/Switch1' */
11928 L4_MABX_B.Switch1_aq = L4_MABX_B.UnitDelay_lj;
11929 }
11930
11931 L4_MABX_B.Switch1_pb = L4_MABX_B.Switch1_aq;
11932 }
11933
11934 /* End of Switch: '<S294>/Switch1' */
11935
11936 /* DataTypeConversion: '<S291>/Conversion' */
11937 L4_MABX_B.Conversion_b = L4_MABX_B.Switch1_pb;
11938
11939 /* Gain: '<S80>/mm2m' */
11940 L4_MABX_B.mm2m = L4_MABX_P.mm2m_Gain * L4_MABX_B.correctedError;
11941
11942 /* Switch: '<S80>/Switch3' incorporates:
11943 * Constant: '<S80>/usePIDyForStanley'
11944 */
11945 if (L4_MABX_P.usePIDyForStanley_Value != 0.0) {
11946 L4_MABX_B.Switch3 = L4_MABX_B.Switch2_i;
11947 } else {
11948 L4_MABX_B.Switch3 = L4_MABX_B.mm2m;
11949 }
11950
11951 /* End of Switch: '<S80>/Switch3' */
11952
11953 /* Gain: '<S80>/sign3' */
11954 L4_MABX_B.sign3 = L4_MABX_P.sign3_Gain * L4_MABX_B.Switch3;
11955
11956 /* Sum: '<S80>/crossTrackError' */
11957 L4_MABX_B.crossTrackError = L4_MABX_B.Conversion_b + L4_MABX_B.sign3;
11958
11959 /* Product: '<S284>/Product' */
11960 L4_MABX_B.Product_p = L4_MABX_B.AdjustedStanleyGain *
11961 L4_MABX_B.crossTrackError;
11962
11963 /* Saturate: '<S284>/Saturation' */
11964 DeltaTime = L4_MABX_B.DataTypeConversion_ku;
11965 Time56 = L4_MABX_P.Saturation_LowerSat_bq;
11966 PositionFinalLimited = L4_MABX_P.Saturation_UpperSat_e;
11967 if (DeltaTime > PositionFinalLimited) {
11968 L4_MABX_B.Saturation_a = PositionFinalLimited;
11969 } else if (DeltaTime < Time56) {
11970 L4_MABX_B.Saturation_a = Time56;
11971 } else {
11972 L4_MABX_B.Saturation_a = DeltaTime;
11973 }
11974
11975 /* End of Saturate: '<S284>/Saturation' */
11976
11977 /* Gain: '<S284>/kph2mps_' */
11978 L4_MABX_B.kph2mps_ = L4_MABX_P.kph2mps_Gain * L4_MABX_B.Saturation_a;
11979
11980 /* Trigonometry: '<S284>/Trigonometric Function' */
11981 L4_MABX_B.TrigonometricFunction_p = rt_atan2d_snf(L4_MABX_B.Product_p,
11982 L4_MABX_B.kph2mps_);
11983
11984 /* Gain: '<S80>/deg2rad1' */
11985 L4_MABX_B.deg2rad1 = L4_MABX_P.deg2rad1_Gain * L4_MABX_B.uDLookupTable1;
11986
11987 /* RateTransition: '<S284>/TmpRTBAtAdd2Inport2' */
11988 if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) {
11989 L4_MABX_B.TmpRTBAtAdd2Inport2 = L4_MABX_DW.TmpRTBAtAdd2Inport2_Buffer0;
11990 }
11991
11992 /* Sum: '<S284>/Add2' */
11993 L4_MABX_B.Add2_g = L4_MABX_B.deg2rad1 - L4_MABX_B.TmpRTBAtAdd2Inport2;
11994
11995 /* Gain: '<S284>/desHeadingWeight' */
11996 L4_MABX_B.desHeadingWeight = L4_MABX_P.desHeadingWeight_Gain *
11997 L4_MABX_B.Add2_g;
11998
11999 /* Sum: '<S284>/Add1' */
12000 L4_MABX_B.Add1_h = L4_MABX_B.TrigonometricFunction_p +
12001 L4_MABX_B.desHeadingWeight;
12002
12003 /* DataTypeConversion: '<S310>/Data Type Conversion' incorporates:
12004 * Constant: '<S310>/RATE_LIMITER_ENABLE_APV'
12005 */
12006 L4_MABX_B.DataTypeConversion_l = (real_T)RATE_LIMITER_ENABLE_APV;
12007
12008 /* Lookup_n-D: '<S310>/Saturation Speed Lookup' */
12009 L4_MABX_B.SaturationSpeedLookup = look1_binlcapw
12010 (L4_MABX_B.DataTypeConversion_ku, L4_MABX_P.SaturationSpeedLookup_bp01Data,
12011 L4_MABX_P.SaturationSpeedLookup_tableData, 5U);
12012
12013 /* Constant: '<S310>/Constant' */
12014 Lateral_Control_Rate_Limit = Lateral_Control_Rate_Limit_APV;
12015
12016 /* SampleTimeMath: '<S321>/sample time'
12017 *
12018 * About '<S321>/sample time':
12019 * y = K where K = ( w * Ts )
12020 */
12021 L4_MABX_B.sampletime = L4_MABX_P.sampletime_WtEt;
12022
12023 /* Product: '<S321>/delta rise limit' */
12024 L4_MABX_B.deltariselimit = Lateral_Control_Rate_Limit * L4_MABX_B.sampletime;
12025
12026 /* SampleTimeMath: '<S308>/sample time'
12027 *
12028 * About '<S308>/sample time':
12029 * y = K where K = ( w * Ts )
12030 */
12031 L4_MABX_B.sampletime_c = L4_MABX_P.sampletime_WtEt_j;
12032
12033 /* Product: '<S308>/delta rise limit' incorporates:
12034 * Constant: '<S281>/Constant7'
12035 */
12036 L4_MABX_B.deltariselimit_c = Lateral_Control_Error_Rate_Limit *
12037 L4_MABX_B.sampletime_c;
12038
12039 /* MATLAB Function: '<S281>/Error Calc' */
12040 /* MATLAB Function 'STEERCTRL_10ms/SteerController/Error Calc': '<S303>:1' */
12041 /* '<S303>:1:3' */
12042 Lateral_Control_Heading_Error = TargetAzimuth_rad - CurrentAzimuth_rad;
12043 if (Lateral_Control_Heading_Error < -3.1415926535897931) {
12044 /* '<S303>:1:5' */
12045 /* '<S303>:1:6' */
12046 Lateral_Control_Heading_Error += 6.2831853071795862;
12047 } else {
12048 if (Lateral_Control_Heading_Error > 3.1415926535897931) {
12049 /* '<S303>:1:7' */
12050 /* '<S303>:1:8' */
12051 Lateral_Control_Heading_Error -= 6.2831853071795862;
12052 }
12053 }
12054
12055 /* End of MATLAB Function: '<S281>/Error Calc' */
12056
12057 /* UnitDelay: '<S308>/Delay Input2' */
12058 L4_MABX_B.Yk1 = L4_MABX_DW.DelayInput2_DSTATE;
12059
12060 /* Sum: '<S308>/Difference Inputs1' */
12061 L4_MABX_B.UkYk1 = Lateral_Control_Heading_Error - L4_MABX_B.Yk1;
12062
12063 /* RelationalOperator: '<S317>/LowerRelop1' */
12064 L4_MABX_B.LowerRelop1_h = (L4_MABX_B.UkYk1 > L4_MABX_B.deltariselimit_c);
12065
12066 /* Product: '<S308>/delta fall limit' incorporates:
12067 * Constant: '<S281>/Constant8'
12068 */
12069 PositionFinalLimited = -Lateral_Control_Error_Rate_Limit;
12070 L4_MABX_B.deltafalllimit = PositionFinalLimited * L4_MABX_B.sampletime_c;
12071
12072 /* RelationalOperator: '<S317>/UpperRelop' */
12073 L4_MABX_B.UpperRelop_f = (L4_MABX_B.UkYk1 < L4_MABX_B.deltafalllimit);
12074
12075 /* Switch: '<S317>/Switch' */
12076 if (L4_MABX_B.UpperRelop_f) {
12077 L4_MABX_B.Switch_i = L4_MABX_B.deltafalllimit;
12078 } else {
12079 L4_MABX_B.Switch_i = L4_MABX_B.UkYk1;
12080 }
12081
12082 /* End of Switch: '<S317>/Switch' */
12083
12084 /* Switch: '<S317>/Switch2' */
12085 if (L4_MABX_B.LowerRelop1_h) {
12086 L4_MABX_B.Switch2_f = L4_MABX_B.deltariselimit_c;
12087 } else {
12088 L4_MABX_B.Switch2_f = L4_MABX_B.Switch_i;
12089 }
12090
12091 /* End of Switch: '<S317>/Switch2' */
12092
12093 /* Sum: '<S308>/Difference Inputs2' */
12094 L4_MABX_B.DifferenceInputs2 = L4_MABX_B.Switch2_f + L4_MABX_B.Yk1;
12095
12096 /* RelationalOperator: '<S304>/Relational Operator1' incorporates:
12097 * Constant: '<S281>/Constant'
12098 */
12099 L4_MABX_B.RelationalOperator1_p = (L4_MABX_B.DifferenceInputs2 >=
12100 Lateral_Control_Error_Limit);
12101
12102 /* RelationalOperator: '<S304>/Relational Operator' incorporates:
12103 * Constant: '<S281>/Constant1'
12104 */
12105 PositionFinalLimited = -Lateral_Control_Error_Limit;
12106 L4_MABX_B.RelationalOperator_h = (L4_MABX_B.DifferenceInputs2 <=
12107 PositionFinalLimited);
12108
12109 /* Outputs for Atomic SubSystem: '<S304>/If_Then_Else1' */
12110 /* Constant: '<S281>/Constant1' */
12111 PositionFinalLimited = -Lateral_Control_Error_Limit;
12112 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_h, PositionFinalLimited,
12113 L4_MABX_B.DifferenceInputs2, &L4_MABX_B.If_Then_Else1_k);
12114
12115 /* End of Outputs for SubSystem: '<S304>/If_Then_Else1' */
12116
12117 /* Outputs for Atomic SubSystem: '<S304>/If_Then_Else' */
12118
12119 /* Constant: '<S281>/Constant' */
12120 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_p,
12121 Lateral_Control_Error_Limit,
12122 L4_MABX_B.If_Then_Else1_k.Switch,
12123 &L4_MABX_B.If_Then_Else_pn);
12124
12125 /* End of Outputs for SubSystem: '<S304>/If_Then_Else' */
12126
12127 /* Outputs for Atomic SubSystem: '<S281>/If_Then_Else1' */
12128
12129 /* Constant: '<S281>/Zero' */
12130 L4_MABX_If_Then_Else_g(L4_MABX_B.AutonomousEnabled_d,
12131 L4_MABX_B.If_Then_Else_pn.Switch, L4_MABX_P.Zero_Value,
12132 &L4_MABX_B.If_Then_Else1_m);
12133
12134 /* End of Outputs for SubSystem: '<S281>/If_Then_Else1' */
12135
12136 /* Gain: '<S307>/Proportional Gain' */
12137 L4_MABX_B.ProportionalGain = Lateral_Control_P *
12138 L4_MABX_B.If_Then_Else1_m.Switch;
12139
12140 /* DiscreteIntegrator: '<S307>/Integrator' */
12141 if (L4_MABX_B.AutonomousEnabled_d && (L4_MABX_DW.Integrator_PrevResetState <=
12142 0)) {
12143 L4_MABX_DW.Integrator_DSTATE = L4_MABX_P.Integrator_IC;
12144 }
12145
12146 L4_MABX_B.Integrator = L4_MABX_DW.Integrator_DSTATE;
12147
12148 /* End of DiscreteIntegrator: '<S307>/Integrator' */
12149
12150 /* Gain: '<S307>/Derivative Gain' */
12151 L4_MABX_B.DerivativeGain = Lateral_Control_D *
12152 L4_MABX_B.If_Then_Else1_m.Switch;
12153
12154 /* DiscreteIntegrator: '<S307>/Filter' */
12155 if (L4_MABX_B.AutonomousEnabled_d && (L4_MABX_DW.Filter_PrevResetState <= 0))
12156 {
12157 L4_MABX_DW.Filter_DSTATE = L4_MABX_P.Filter_IC;
12158 }
12159
12160 L4_MABX_B.Filter = L4_MABX_DW.Filter_DSTATE;
12161
12162 /* End of DiscreteIntegrator: '<S307>/Filter' */
12163
12164 /* Sum: '<S307>/SumD' */
12165 L4_MABX_B.SumD = L4_MABX_B.DerivativeGain - L4_MABX_B.Filter;
12166
12167 /* Gain: '<S307>/Filter Coefficient' */
12168 L4_MABX_B.FilterCoefficient = L4_MABX_P.PIDController_N * L4_MABX_B.SumD;
12169
12170 /* Sum: '<S307>/Sum' */
12171 L4_MABX_B.Sum_c = (L4_MABX_B.ProportionalGain + L4_MABX_B.Integrator) +
12172 L4_MABX_B.FilterCoefficient;
12173
12174 /* Saturate: '<S307>/Saturate' */
12175 DeltaTime = L4_MABX_B.Sum_c;
12176 Time56 = L4_MABX_P.PIDController_LowerSaturationLi;
12177 PositionFinalLimited = L4_MABX_P.PIDController_UpperSaturationLi;
12178 if (DeltaTime > PositionFinalLimited) {
12179 L4_MABX_B.Saturate = PositionFinalLimited;
12180 } else if (DeltaTime < Time56) {
12181 L4_MABX_B.Saturate = Time56;
12182 } else {
12183 L4_MABX_B.Saturate = DeltaTime;
12184 }
12185
12186 /* End of Saturate: '<S307>/Saturate' */
12187
12188 /* UnitDelay: '<S311>/Delay Input' */
12189 L4_MABX_B.Uk1_m = L4_MABX_DW.DelayInput_DSTATE;
12190
12191 /* Gain: '<S311>/GainZero' */
12192 L4_MABX_B.ZeroUk1 = Lateral_Control_Zero * L4_MABX_B.Uk1_m;
12193
12194 /* UnitDelay: '<S311>/Delay Output' */
12195 L4_MABX_B.Yk1_p = L4_MABX_DW.DelayOutput_DSTATE;
12196
12197 /* Gain: '<S311>/GainPole' */
12198 L4_MABX_B.PoleYk1 = Lateral_Control_Pole * L4_MABX_B.Yk1_p;
12199
12200 /* Sum: '<S311>/Sum' */
12201 L4_MABX_B.PoleYk1UkZeroUk1 = (L4_MABX_B.Saturate - L4_MABX_B.ZeroUk1) +
12202 L4_MABX_B.PoleYk1;
12203
12204 /* DataTypeConversion: '<S311>/Downcast' */
12205 L4_MABX_B.Downcast = L4_MABX_B.PoleYk1UkZeroUk1;
12206
12207 /* Sum: '<S281>/Subtract' incorporates:
12208 * Constant: '<S281>/Constant6'
12209 */
12210 L4_MABX_B.Subtract_c = ReAX_ActualHandwheelPos - REAX_OFFSET_APV;
12211
12212 /* Lookup_n-D: '<S281>/1-D Lookup Table' */
12213 L4_MABX_B.uDLookupTable_j = look1_binlxpw(L4_MABX_B.Subtract_c,
12214 L4_MABX_P.uDLookupTable_bp01Data_d, L4_MABX_P.uDLookupTable_tableData_d, 71U);
12215
12216 /* Gain: '<S281>/deg2rad' */
12217 L4_MABX_B.deg2rad = L4_MABX_P.deg2rad_Gain_l * L4_MABX_B.uDLookupTable_j;
12218
12219 /* Gain: '<S281>/invert' */
12220 L4_MABX_B.invert = L4_MABX_P.invert_Gain_i * L4_MABX_B.deg2rad;
12221
12222 /* Gain: '<S281>/PGain' */
12223 L4_MABX_B.PGain = Lateral_Control_P * L4_MABX_B.If_Then_Else_pn.Switch;
12224
12225 /* SampleTimeMath: '<S309>/sample time'
12226 *
12227 * About '<S309>/sample time':
12228 * y = K where K = ( w * Ts )
12229 */
12230 L4_MABX_B.sampletime_a = L4_MABX_P.sampletime_WtEt_p;
12231
12232 /* Product: '<S309>/delta rise limit' incorporates:
12233 * Constant: '<S281>/Constant9'
12234 */
12235 L4_MABX_B.deltariselimit_o = Lateral_Control_Error_Rate_Limit *
12236 L4_MABX_B.sampletime_a;
12237
12238 /* Sum: '<S281>/Sum' incorporates:
12239 * Constant: '<S281>/YAW_RATE_OFFSET_APV'
12240 */
12241 L4_MABX_B.Sum_ly = YawRate + YAW_RATE_OFFSET_APV;
12242
12243 /* RelationalOperator: '<S312>/Relational Operator1' incorporates:
12244 * Constant: '<S281>/Constant2'
12245 */
12246 L4_MABX_B.RelationalOperator1_f = (L4_MABX_B.Sum_ly >=
12247 Lateral_Control_YawRate_Limit);
12248
12249 /* RelationalOperator: '<S312>/Relational Operator' incorporates:
12250 * Constant: '<S281>/Constant4'
12251 */
12252 PositionFinalLimited = -Lateral_Control_YawRate_Limit;
12253 L4_MABX_B.RelationalOperator_l4 = (L4_MABX_B.Sum_ly <= PositionFinalLimited);
12254
12255 /* Outputs for Atomic SubSystem: '<S312>/If_Then_Else1' */
12256 /* Constant: '<S281>/Constant4' */
12257 PositionFinalLimited = -Lateral_Control_YawRate_Limit;
12258 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_l4, PositionFinalLimited,
12259 L4_MABX_B.Sum_ly, &L4_MABX_B.If_Then_Else1_o0);
12260
12261 /* End of Outputs for SubSystem: '<S312>/If_Then_Else1' */
12262
12263 /* Outputs for Atomic SubSystem: '<S312>/If_Then_Else' */
12264
12265 /* Constant: '<S281>/Constant2' */
12266 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_f,
12267 Lateral_Control_YawRate_Limit,
12268 L4_MABX_B.If_Then_Else1_o0.Switch,
12269 &L4_MABX_B.If_Then_Else_m0);
12270
12271 /* End of Outputs for SubSystem: '<S312>/If_Then_Else' */
12272
12273 /* Gain: '<S281>/RateFeedbackGain' */
12274 L4_MABX_B.RateFeedbackGain = Yaw_Rate_FF_Gain *
12275 L4_MABX_B.If_Then_Else_m0.Switch;
12276
12277 /* RelationalOperator: '<S302>/Relational Operator1' incorporates:
12278 * Constant: '<S281>/Constant3'
12279 */
12280 L4_MABX_B.RelationalOperator1_gr = (Curvature >=
12281 Lateral_Control_Curvature_Limit);
12282
12283 /* RelationalOperator: '<S302>/Relational Operator' incorporates:
12284 * Constant: '<S281>/Constant5'
12285 */
12286 PositionFinalLimited = -Lateral_Control_Curvature_Limit;
12287 L4_MABX_B.RelationalOperator_o = (Curvature <= PositionFinalLimited);
12288
12289 /* Outputs for Atomic SubSystem: '<S302>/If_Then_Else1' */
12290 /* Constant: '<S281>/Constant5' */
12291 PositionFinalLimited = -Lateral_Control_Curvature_Limit;
12292 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator_o, PositionFinalLimited,
12293 Curvature, &L4_MABX_B.If_Then_Else1_d);
12294
12295 /* End of Outputs for SubSystem: '<S302>/If_Then_Else1' */
12296
12297 /* Outputs for Atomic SubSystem: '<S302>/If_Then_Else' */
12298
12299 /* Constant: '<S281>/Constant3' */
12300 L4_MABX_If_Then_Else(L4_MABX_B.RelationalOperator1_gr,
12301 Lateral_Control_Curvature_Limit,
12302 L4_MABX_B.If_Then_Else1_d.Switch,
12303 &L4_MABX_B.If_Then_Else_p);
12304
12305 /* End of Outputs for SubSystem: '<S302>/If_Then_Else' */
12306
12307 /* Gain: '<S281>/FeedforwardGain' */
12308 L4_MABX_B.FeedforwardGain = Curvature_FF_Gain *
12309 L4_MABX_B.If_Then_Else_p.Switch;
12310
12311 /* Gain: '<S281>/UndersteerCorrection' */
12312 L4_MABX_B.UndersteerCorrection = UndersteerCorection *
12313 L4_MABX_B.FeedforwardGain;
12314
12315 /* Sum: '<S281>/Sum2' */
12316 L4_MABX_B.Sum2 = L4_MABX_B.UndersteerCorrection - L4_MABX_B.RateFeedbackGain;
12317
12318 /* UnitDelay: '<S309>/Delay Input2' */
12319 L4_MABX_B.Yk1_o = L4_MABX_DW.DelayInput2_DSTATE_a;
12320
12321 /* Sum: '<S309>/Difference Inputs1' */
12322 L4_MABX_B.UkYk1_n = L4_MABX_B.Sum2 - L4_MABX_B.Yk1_o;
12323
12324 /* RelationalOperator: '<S318>/LowerRelop1' */
12325 L4_MABX_B.LowerRelop1_o = (L4_MABX_B.UkYk1_n > L4_MABX_B.deltariselimit_o);
12326
12327 /* Product: '<S309>/delta fall limit' incorporates:
12328 * Constant: '<S281>/Constant10'
12329 */
12330 PositionFinalLimited = -Lateral_Control_Error_Rate_Limit;
12331 L4_MABX_B.deltafalllimit_o = PositionFinalLimited * L4_MABX_B.sampletime_a;
12332
12333 /* RelationalOperator: '<S318>/UpperRelop' */
12334 L4_MABX_B.UpperRelop_o = (L4_MABX_B.UkYk1_n < L4_MABX_B.deltafalllimit_o);
12335
12336 /* Switch: '<S318>/Switch' */
12337 if (L4_MABX_B.UpperRelop_o) {
12338 L4_MABX_B.Switch_ea = L4_MABX_B.deltafalllimit_o;
12339 } else {
12340 L4_MABX_B.Switch_ea = L4_MABX_B.UkYk1_n;
12341 }
12342
12343 /* End of Switch: '<S318>/Switch' */
12344
12345 /* Switch: '<S318>/Switch2' */
12346 if (L4_MABX_B.LowerRelop1_o) {
12347 L4_MABX_B.Switch2_e = L4_MABX_B.deltariselimit_o;
12348 } else {
12349 L4_MABX_B.Switch2_e = L4_MABX_B.Switch_ea;
12350 }
12351
12352 /* End of Switch: '<S318>/Switch2' */
12353
12354 /* Sum: '<S309>/Difference Inputs2' */
12355 L4_MABX_B.DifferenceInputs2_a = L4_MABX_B.Switch2_e + L4_MABX_B.Yk1_o;
12356
12357 /* Sum: '<S281>/Sum3' */
12358 L4_MABX_B.Sum3 = (L4_MABX_B.invert - L4_MABX_B.PGain) -
12359 L4_MABX_B.DifferenceInputs2_a;
12360
12361 /* DiscreteIntegrator: '<S301>/Discrete-Time Integrator' */
12362 if (L4_MABX_DW.DiscreteTimeIntegrator_IC_LOADI != 0) {
12363 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE = L4_MABX_B.Sum3;
12364 }
12365
12366 if (L4_MABX_B.AutonomousEnabled_d &&
12367 (L4_MABX_DW.DiscreteTimeIntegrator_PrevRese <= 0)) {
12368 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE = L4_MABX_B.Sum3;
12369 }
12370
12371 L4_MABX_B.DiscreteTimeIntegrator = L4_MABX_DW.DiscreteTimeIntegrator_DSTATE;
12372
12373 /* End of DiscreteIntegrator: '<S301>/Discrete-Time Integrator' */
12374
12375 /* Sum: '<S281>/Sum4' */
12376 L4_MABX_B.Sum4 = L4_MABX_B.Downcast + L4_MABX_B.DiscreteTimeIntegrator;
12377
12378 /* Sum: '<S281>/Sum1' */
12379 Lateral_Control_Output = L4_MABX_B.Sum4 + L4_MABX_B.DifferenceInputs2_a;
12380
12381 /* UnitDelay: '<S321>/Delay Input2' */
12382 L4_MABX_B.Yk1_pm = L4_MABX_DW.DelayInput2_DSTATE_l;
12383
12384 /* Sum: '<S321>/Difference Inputs1' */
12385 L4_MABX_B.UkYk1_f = Lateral_Control_Output - L4_MABX_B.Yk1_pm;
12386
12387 /* RelationalOperator: '<S323>/LowerRelop1' */
12388 L4_MABX_B.LowerRelop1_l = (L4_MABX_B.UkYk1_f > L4_MABX_B.deltariselimit);
12389
12390 /* Gain: '<S310>/Gain3' */
12391 L4_MABX_B.RateLimitLower = L4_MABX_P.Gain3_Gain_p * Lateral_Control_Rate_Limit;
12392
12393 /* Product: '<S321>/delta fall limit' */
12394 L4_MABX_B.deltafalllimit_n = L4_MABX_B.RateLimitLower * L4_MABX_B.sampletime;
12395
12396 /* RelationalOperator: '<S323>/UpperRelop' */
12397 L4_MABX_B.UpperRelop_k = (L4_MABX_B.UkYk1_f < L4_MABX_B.deltafalllimit_n);
12398
12399 /* Switch: '<S323>/Switch' */
12400 if (L4_MABX_B.UpperRelop_k) {
12401 L4_MABX_B.Switch_fu = L4_MABX_B.deltafalllimit_n;
12402 } else {
12403 L4_MABX_B.Switch_fu = L4_MABX_B.UkYk1_f;
12404 }
12405
12406 /* End of Switch: '<S323>/Switch' */
12407
12408 /* Switch: '<S323>/Switch2' */
12409 if (L4_MABX_B.LowerRelop1_l) {
12410 L4_MABX_B.Switch2_fa = L4_MABX_B.deltariselimit;
12411 } else {
12412 L4_MABX_B.Switch2_fa = L4_MABX_B.Switch_fu;
12413 }
12414
12415 /* End of Switch: '<S323>/Switch2' */
12416
12417 /* Sum: '<S321>/Difference Inputs2' */
12418 L4_MABX_B.DifferenceInputs2_m = L4_MABX_B.Switch2_fa + L4_MABX_B.Yk1_pm;
12419
12420 /* RelationalOperator: '<S322>/LowerRelop1' */
12421 L4_MABX_B.LowerRelop1_e = (L4_MABX_B.DifferenceInputs2_m >
12422 L4_MABX_B.SaturationSpeedLookup);
12423
12424 /* Gain: '<S310>/Gain1' */
12425 L4_MABX_B.Gain1_f = L4_MABX_P.Gain1_Gain_p * L4_MABX_B.SaturationSpeedLookup;
12426
12427 /* RelationalOperator: '<S322>/UpperRelop' */
12428 L4_MABX_B.UpperRelop_fl = (L4_MABX_B.DifferenceInputs2_m < L4_MABX_B.Gain1_f);
12429
12430 /* Switch: '<S322>/Switch' */
12431 if (L4_MABX_B.UpperRelop_fl) {
12432 L4_MABX_B.Switch_hx = L4_MABX_B.Gain1_f;
12433 } else {
12434 L4_MABX_B.Switch_hx = L4_MABX_B.DifferenceInputs2_m;
12435 }
12436
12437 /* End of Switch: '<S322>/Switch' */
12438
12439 /* Switch: '<S322>/Switch2' */
12440 if (L4_MABX_B.LowerRelop1_e) {
12441 L4_MABX_B.Switch2_k = L4_MABX_B.SaturationSpeedLookup;
12442 } else {
12443 L4_MABX_B.Switch2_k = L4_MABX_B.Switch_hx;
12444 }
12445
12446 /* End of Switch: '<S322>/Switch2' */
12447
12448 /* Outputs for Atomic SubSystem: '<S310>/If_Then_Else' */
12449 L4_MABX_If_Then_Else_c(L4_MABX_B.DataTypeConversion_l, L4_MABX_B.Switch2_k,
12450 Lateral_Control_Output, &L4_MABX_B.If_Then_Else_co);
12451
12452 /* End of Outputs for SubSystem: '<S310>/If_Then_Else' */
12453
12454 /* SignalConversion: '<S310>/TmpSignal ConversionAtIf_Then_ElseOutport1' */
12455 Lateral_Control_Rate_Limiter_Output = L4_MABX_B.If_Then_Else_co.Switch;
12456
12457 /* MATLAB Function: '<S280>/Error Calc' */
12458 /* MATLAB Function 'STEERCTRL_10ms/StanleyController/Error Calc': '<S299>:1' */
12459 /* '<S299>:1:3' */
12460 L4_MABX_B.error = TargetAzimuth_rad - CurrentAzimuth_rad;
12461 if (L4_MABX_B.error < -3.1415926535897931) {
12462 /* '<S299>:1:5' */
12463 /* '<S299>:1:6' */
12464 L4_MABX_B.error += 6.2831853071795862;
12465 } else {
12466 if (L4_MABX_B.error > 3.1415926535897931) {
12467 /* '<S299>:1:7' */
12468 /* '<S299>:1:8' */
12469 L4_MABX_B.error -= 6.2831853071795862;
12470 }
12471 }
12472
12473 /* End of MATLAB Function: '<S280>/Error Calc' */
12474
12475 /* MultiPortSwitch: '<S80>/Multiport Switch2' incorporates:
12476 * Constant: '<S80>/LAT_STEER_SRC_SELECTOR_APV'
12477 */
12478 if (LAT_STEER_SRC_SELECTOR_APV == ENUM_LAT_STEER_SOURCE_T_PIC_HARIS) {
12479 /* Outputs for Atomic SubSystem: '<S281>/If_Then_Else' */
12480 L4_MABX_If_Then_Else_g(L4_MABX_B.AutonomousEnabled_d,
12481 Lateral_Control_Rate_Limiter_Output, L4_MABX_B.invert,
12482 &L4_MABX_B.If_Then_Else_m1);
12483
12484 /* End of Outputs for SubSystem: '<S281>/If_Then_Else' */
12485 L4_MABX_B.MultiportSwitch2 = L4_MABX_B.If_Then_Else_m1.Switch;
12486 } else {
12487 /* Saturate: '<S280>/Speed Saturation' */
12488 DeltaTime = L4_MABX_B.DataTypeConversion_ku;
12489 Time56 = L4_MABX_P.SpeedSaturation_LowerSat;
12490 PositionFinalLimited = L4_MABX_P.SpeedSaturation_UpperSat;
12491 if (DeltaTime > PositionFinalLimited) {
12492 L4_MABX_B.SpeedSaturation = PositionFinalLimited;
12493 } else if (DeltaTime < Time56) {
12494 L4_MABX_B.SpeedSaturation = Time56;
12495 } else {
12496 L4_MABX_B.SpeedSaturation = DeltaTime;
12497 }
12498
12499 /* End of Saturate: '<S280>/Speed Saturation' */
12500
12501 /* Gain: '<S280>/km//h to m//s' */
12502 L4_MABX_B.kmhtoms = L4_MABX_P.kmhtoms_Gain * L4_MABX_B.SpeedSaturation;
12503
12504 /* Product: '<S280>/Product' incorporates:
12505 * Constant: '<S280>/StanleySteeringControlGain'
12506 */
12507 L4_MABX_B.Product_n = STANLEY_GAIN_APV * CrosstrackError;
12508
12509 /* Trigonometry: '<S280>/Trigonometric Function' */
12510 L4_MABX_B.TrigonometricFunction_l = rt_atan2d_snf(L4_MABX_B.Product_n,
12511 L4_MABX_B.kmhtoms);
12512
12513 /* Saturate: '<S280>/Error Saturation' */
12514 DeltaTime = L4_MABX_B.error;
12515 Time56 = L4_MABX_P.ErrorSaturation_LowerSat;
12516 PositionFinalLimited = L4_MABX_P.ErrorSaturation_UpperSat;
12517 if (DeltaTime > PositionFinalLimited) {
12518 L4_MABX_B.ErrorSaturation = PositionFinalLimited;
12519 } else if (DeltaTime < Time56) {
12520 L4_MABX_B.ErrorSaturation = Time56;
12521 } else {
12522 L4_MABX_B.ErrorSaturation = DeltaTime;
12523 }
12524
12525 /* End of Saturate: '<S280>/Error Saturation' */
12526
12527 /* Sum: '<S280>/Sum1' */
12528 L4_MABX_B.Sum1 = L4_MABX_B.ErrorSaturation +
12529 L4_MABX_B.TrigonometricFunction_l;
12530
12531 /* Sum: '<S280>/Subtract' incorporates:
12532 * Constant: '<S280>/ReAX Offset'
12533 */
12534 L4_MABX_B.Subtract_e = ReAX_ActualHandwheelPos - REAX_OFFSET_APV;
12535
12536 /* Lookup_n-D: '<S280>/1-D Lookup Table' */
12537 L4_MABX_B.uDLookupTable_h = look1_binlxpw(L4_MABX_B.Subtract_e,
12538 L4_MABX_P.uDLookupTable_bp01Data_k, L4_MABX_P.uDLookupTable_tableData_k,
12539 71U);
12540
12541 /* Gain: '<S280>/deg2rad' */
12542 L4_MABX_B.deg2rad_o = L4_MABX_P.deg2rad_Gain_n * L4_MABX_B.uDLookupTable_h;
12543
12544 /* Gain: '<S280>/invert' */
12545 L4_MABX_B.invert_d = L4_MABX_P.invert_Gain * L4_MABX_B.deg2rad_o;
12546
12547 /* Outputs for Atomic SubSystem: '<S280>/If_Then_Else' */
12548 L4_MABX_If_Then_Else_g(L4_MABX_B.AutonomousEnabled_d, L4_MABX_B.Sum1,
12549 L4_MABX_B.invert_d, &L4_MABX_B.If_Then_Else_nh);
12550
12551 /* End of Outputs for SubSystem: '<S280>/If_Then_Else' */
12552 L4_MABX_B.MultiportSwitch2 = L4_MABX_B.If_Then_Else_nh.Switch;
12553 }
12554
12555 /* End of MultiPortSwitch: '<S80>/Multiport Switch2' */
12556
12557 /* DataTypeConversion: '<S80>/Data Type Conversion6' */
12558 L4_MABX_B.DataTypeConversion6_pa = L4_MABX_B.MultiportSwitch2;
12559
12560 /* Gain: '<S80>/rad2deg' */
12561 L4_MABX_B.rad2deg = L4_MABX_P.rad2deg_Gain * L4_MABX_B.DataTypeConversion6_pa;
12562
12563 /* Gain: '<S80>/sign flip' */
12564 SteerCommandDeg = L4_MABX_P.signflip_Gain * L4_MABX_B.rad2deg;
12565
12566 /* MultiPortSwitch: '<S80>/Multiport Switch1' incorporates:
12567 * Constant: '<S80>/LONG_SPEED_SRC_SELECTOR_APV'
12568 * Constant: '<S80>/SteeringOverrideVal1'
12569 */
12570 switch (LONG_SPEED_SRC_SELECTOR_APV) {
12571 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_GPS_PATH:
12572 /* MultiPortSwitch: '<S80>/Multiport Switch' incorporates:
12573 * Constant: '<S80>/SteeringControlSRC'
12574 * Constant: '<S80>/SteeringOverrideVal'
12575 */
12576 switch (L4_MABX_P.SteeringControlSRC_Value) {
12577 case 0:
12578 L4_MABX_B.MultiportSwitch_f = L4_MABX_P.SteeringOverrideVal_Value;
12579 break;
12580
12581 case 1:
12582 L4_MABX_B.MultiportSwitch_f = L4_MABX_B.Switch2_i;
12583 break;
12584
12585 case 2:
12586 /* DataTypeConversion: '<S80>/Data Type Conversion2' */
12587 L4_MABX_B.DataTypeConversion2_ox = L4_MABX_B.Add2;
12588 L4_MABX_B.MultiportSwitch_f = L4_MABX_B.DataTypeConversion2_ox;
12589 break;
12590
12591 default:
12592 /* DataTypeConversion: '<S80>/Data Type Conversion3' */
12593 L4_MABX_B.DataTypeConversion3_p = L4_MABX_B.Add1_h;
12594 L4_MABX_B.MultiportSwitch_f = L4_MABX_B.DataTypeConversion3_p;
12595 break;
12596 }
12597
12598 /* End of MultiPortSwitch: '<S80>/Multiport Switch' */
12599
12600 /* Gain: '<S80>/rad2deg2' */
12601 L4_MABX_B.rad2deg2 = L4_MABX_P.rad2deg2_Gain * L4_MABX_B.MultiportSwitch_f;
12602 L4_MABX_B.MultiportSwitch1 = L4_MABX_B.rad2deg2;
12603 break;
12604
12605 case ENUM_LONG_SPEED_DEMAND_SOURCE_T_OVERRIDE:
12606 L4_MABX_B.MultiportSwitch1 = L4_MABX_P.SteeringOverrideVal1_Value;
12607 break;
12608
12609 default:
12610 L4_MABX_B.MultiportSwitch1 = SteerCommandDeg;
12611 break;
12612 }
12613
12614 /* End of MultiPortSwitch: '<S80>/Multiport Switch1' */
12615
12616 /* Lookup_n-D: '<S276>/1D_Lookup_Table' */
12617 L4_MABX_B.uD_Lookup_Table_a = look1_binlcapw(L4_MABX_B.MultiportSwitch1,
12618 STEERCTRL_WHEEL_ANGLE_STEP_MPV, STEERCTRL_WHEEL_ANGLE_DATA_MPV, 71U);
12619
12620 /* DataTypeConversion: '<S80>/Data Type Conversion4' */
12621 L4_MABX_B.numLanePoints_j = L4_MABX_B.DataTypeConversion5_e;
12622
12623 /* DiscreteIntegrator: '<S80>/Discrete-Time Integrator' incorporates:
12624 * Constant: '<S80>/ResetIntegrator'
12625 */
12626 if ((L4_MABX_P.ResetIntegrator_Value != 0.0) ||
12627 (L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e != 0)) {
12628 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e =
12629 L4_MABX_P.DiscreteTimeIntegrator_IC;
12630 }
12631
12632 if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e >=
12633 L4_MABX_P.DiscreteTimeIntegrator_UpperSat) {
12634 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e =
12635 L4_MABX_P.DiscreteTimeIntegrator_UpperSat;
12636 } else {
12637 if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e <=
12638 L4_MABX_P.DiscreteTimeIntegrator_LowerSat) {
12639 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e =
12640 L4_MABX_P.DiscreteTimeIntegrator_LowerSat;
12641 }
12642 }
12643
12644 L4_MABX_B.DiscreteTimeIntegrator_h =
12645 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e;
12646
12647 /* End of DiscreteIntegrator: '<S80>/Discrete-Time Integrator' */
12648
12649 /* RelationalOperator: '<S288>/Lower Test' incorporates:
12650 * Constant: '<S288>/Lower Limit'
12651 */
12652 L4_MABX_B.LowerTest = (L4_MABX_P.IntervalTest_lowlimit <= L4_MABX_B.Divide_nn);
12653
12654 /* RelationalOperator: '<S288>/Upper Test' incorporates:
12655 * Constant: '<S288>/Upper Limit'
12656 */
12657 L4_MABX_B.UpperTest = (L4_MABX_B.Divide_nn <= L4_MABX_P.IntervalTest_uplimit);
12658
12659 /* Logic: '<S288>/AND' */
12660 L4_MABX_B.AND_ps = (L4_MABX_B.LowerTest && L4_MABX_B.UpperTest);
12661
12662 /* Assertion: '<S285>/Assertion' */
12663 utAssert(L4_MABX_B.AND_ps);
12664
12665 /* RelationalOperator: '<S293>/Lower Test' incorporates:
12666 * Constant: '<S293>/Lower Limit'
12667 */
12668 L4_MABX_B.LowerTest_l = (L4_MABX_P.IntervalTest_lowlimit_k <=
12669 L4_MABX_B.Divide_d0);
12670
12671 /* RelationalOperator: '<S293>/Upper Test' incorporates:
12672 * Constant: '<S293>/Upper Limit'
12673 */
12674 L4_MABX_B.UpperTest_e = (L4_MABX_B.Divide_d0 <=
12675 L4_MABX_P.IntervalTest_uplimit_e);
12676
12677 /* Logic: '<S293>/AND' */
12678 L4_MABX_B.AND_jt = (L4_MABX_B.LowerTest_l && L4_MABX_B.UpperTest_e);
12679
12680 /* Assertion: '<S290>/Assertion' */
12681 utAssert(L4_MABX_B.AND_jt);
12682
12683 /* Switch: '<S296>/Switch' incorporates:
12684 * Constant: '<S279>/Constant8'
12685 * Constant: '<S279>/Constant9'
12686 */
12687 if (L4_MABX_P.Constant8_Value_l) {
12688 L4_MABX_B.Switch_ko = L4_MABX_P.Constant9_Value;
12689 } else {
12690 L4_MABX_B.Switch_ko = L4_MABX_B.Add_px;
12691 }
12692
12693 /* End of Switch: '<S296>/Switch' */
12694
12695 /* RelationalOperator: '<S80>/Relational Operator' incorporates:
12696 * Constant: '<S80>/Constant1'
12697 */
12698 L4_MABX_B.RelationalOperator_oq = (L4_MABX_B.DataTypeConversion5_e >=
12699 L4_MABX_P.Constant1_Value_lsu);
12700
12701 /* Gain: '<S301>/Gain' */
12702 L4_MABX_B.Gain_o = L4_MABX_P.Gain_Gain_p * L4_MABX_B.DiscreteTimeIntegrator;
12703
12704 /* Gain: '<S307>/Integral Gain' */
12705 L4_MABX_B.IntegralGain = Lateral_Control_I * L4_MABX_B.If_Then_Else1_m.Switch;
12706
12707 /* Abs: '<S310>/Abs' */
12708 L4_MABX_B.Abs_ig = fabs(L4_MABX_B.If_Then_Else_p.Switch);
12709
12710 /* Abs: '<S310>/Abs1' */
12711 L4_MABX_B.Abs1_ft = fabs(L4_MABX_B.DifferenceInputs2);
12712
12713 /* Sum: '<S310>/Subtract' */
12714 L4_MABX_B.Subtract_o = Lateral_Control_Output - L4_MABX_B.DifferenceInputs2_m;
12715
12716 /* Abs: '<S310>/Abs2' */
12717 L4_MABX_B.Abs2_k = fabs(L4_MABX_B.Subtract_o);
12718
12719 /* RelationalOperator: '<S319>/Compare' incorporates:
12720 * Constant: '<S319>/Constant'
12721 */
12722 RateLimiterActive = (L4_MABX_B.Abs2_k > L4_MABX_P.CompareToConstant_const_g);
12723
12724 /* Lookup_n-D: '<S310>/Curvature Lookup Table' */
12725 L4_MABX_B.RateCurvature = look1_binlcapw(L4_MABX_B.Abs_ig,
12726 L4_MABX_P.CurvatureLookupTable_bp01Data,
12727 L4_MABX_P.CurvatureLookupTable_tableData, 4U);
12728
12729 /* Lookup_n-D: '<S310>/Error Lookup Table' */
12730 L4_MABX_B.RateError = look1_binlcapw(L4_MABX_B.Abs1_ft,
12731 L4_MABX_P.ErrorLookupTable_bp01Data, L4_MABX_P.ErrorLookupTable_tableData,
12732 4U);
12733
12734 /* MinMax: '<S310>/Max' */
12735 DeltaTime = L4_MABX_B.RateCurvature;
12736 PositionFinalLimited = L4_MABX_B.RateError;
12737 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
12738 PositionFinalLimited = DeltaTime;
12739 }
12740
12741 L4_MABX_B.Max = PositionFinalLimited;
12742
12743 /* End of MinMax: '<S310>/Max' */
12744
12745 /* Lookup_n-D: '<S310>/Speed Lookup Table' */
12746 L4_MABX_B.RateSpeed = look1_binlcapw(L4_MABX_B.DataTypeConversion_ku,
12747 L4_MABX_P.SpeedLookupTable_bp01Data, L4_MABX_P.SpeedLookupTable_tableData,
12748 5U);
12749
12750 /* MinMax: '<S310>/Min' */
12751 DeltaTime = L4_MABX_B.Max;
12752 PositionFinalLimited = L4_MABX_B.RateSpeed;
12753 if ((DeltaTime < PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
12754 PositionFinalLimited = DeltaTime;
12755 }
12756
12757 L4_MABX_B.Min = PositionFinalLimited;
12758
12759 /* End of MinMax: '<S310>/Min' */
12760
12761 /* RateLimiter: '<S310>/Limit Rate Limiter' */
12762 PositionFinalLimited = L4_MABX_B.Min - L4_MABX_DW.PrevY;
12763 if (PositionFinalLimited > L4_MABX_P.LimitRateLimiter_RisingLim) {
12764 L4_MABX_B.RateLimitUpper = L4_MABX_DW.PrevY +
12765 L4_MABX_P.LimitRateLimiter_RisingLim;
12766 } else if (PositionFinalLimited < L4_MABX_P.LimitRateLimiter_FallingLim) {
12767 L4_MABX_B.RateLimitUpper = L4_MABX_DW.PrevY +
12768 L4_MABX_P.LimitRateLimiter_FallingLim;
12769 } else {
12770 L4_MABX_B.RateLimitUpper = L4_MABX_B.Min;
12771 }
12772
12773 L4_MABX_DW.PrevY = L4_MABX_B.RateLimitUpper;
12774
12775 /* End of RateLimiter: '<S310>/Limit Rate Limiter' */
12776
12777 /* Gain: '<S80>/sign2' */
12778 DesiredSteeringAngle = L4_MABX_P.sign2_Gain * L4_MABX_B.uD_Lookup_Table_a;
12779
12780 /* Sum: '<S80>/Subtract' incorporates:
12781 * Constant: '<S80>/Constant'
12782 */
12783 L4_MABX_B.Subtract_c1 = DesiredSteeringAngle + REAX_OFFSET_APV;
12784
12785 /* UnitDelay: '<S80>/Unit Delay' */
12786 L4_MABX_B.UnitDelay_p = L4_MABX_DW.UnitDelay_DSTATE_e3;
12787
12788 /* Switch: '<S80>/Switch1' incorporates:
12789 * Constant: '<S80>/Constant2'
12790 * Switch: '<S80>/Switch2'
12791 */
12792 if (L4_MABX_B.RelationalOperator_oq) {
12793 /* Product: '<S80>/Product3' incorporates:
12794 * Constant: '<S80>/SteeringControlNewIGain1'
12795 */
12796 L4_MABX_B.Product3 = L4_MABX_B.mm2m *
12797 L4_MABX_P.SteeringControlNewIGain1_Value;
12798 L4_MABX_B.Switch1_p = L4_MABX_B.Product3;
12799
12800 /* Gain: '<S80>/deg2rad' */
12801 L4_MABX_B.deg2rad_d = L4_MABX_P.deg2rad_Gain * L4_MABX_B.SFunction1_o1_m;
12802
12803 /* Product: '<S80>/Product2' incorporates:
12804 * Constant: '<S80>/SteeringControlNewPGain1'
12805 */
12806 L4_MABX_B.Product2_my = L4_MABX_B.deg2rad_d *
12807 L4_MABX_P.SteeringControlNewPGain1_Value;
12808 L4_MABX_B.Switch2_i1 = L4_MABX_B.Product2_my;
12809 } else {
12810 L4_MABX_B.Switch1_p = L4_MABX_P.Constant2_Value_n;
12811 L4_MABX_B.Switch2_i1 = L4_MABX_B.UnitDelay_p;
12812 }
12813
12814 /* End of Switch: '<S80>/Switch1' */
12815
12816 /* RelationalOperator: '<S353>/min_relop' incorporates:
12817 * Constant: '<S353>/min_val'
12818 */
12819 L4_MABX_B.min_relop_k0 = (L4_MABX_P.CheckStaticLowerBound_min_o <=
12820 L4_MABX_B.Divide_e);
12821
12822 /* Assertion: '<S353>/Assertion' */
12823 utAssert(L4_MABX_B.min_relop_k0);
12824
12825 /* Logic: '<S362>/Logical Operator2' */
12826 L4_MABX_B.LogicalOperator2_g = !L4_MABX_B.LogicalOperator1_p;
12827
12828 /* Switch: '<S371>/Reset' incorporates:
12829 * Constant: '<S366>/CPV'
12830 */
12831 if (L4_MABX_B.LogicalOperator1_ja) {
12832 L4_MABX_B.Xnew = L4_MABX_P.CPV_Value_h;
12833 } else {
12834 L4_MABX_B.Xnew = L4_MABX_B.If_Then_Else_gf.Switch;
12835 }
12836
12837 /* End of Switch: '<S371>/Reset' */
12838
12839 /* UnitDelay: '<S373>/FixPt Unit Delay2' */
12840 L4_MABX_B.FixPtUnitDelay2_j = L4_MABX_DW.FixPtUnitDelay2_DSTATE_aw;
12841
12842 /* Logic: '<S373>/FixPt Logical Operator' */
12843 L4_MABX_B.FixPtLogicalOperator_i = (uint8_T)(L4_MABX_B.LogicalOperator1_ja ||
12844 (L4_MABX_B.FixPtUnitDelay2_j != 0));
12845
12846 /* UnitDelay: '<S373>/FixPt Unit Delay1' */
12847 L4_MABX_B.Xold_d = L4_MABX_DW.FixPtUnitDelay1_DSTATE_pe;
12848
12849 /* Switch: '<S373>/Init' incorporates:
12850 * Constant: '<S367>/CPV'
12851 */
12852 if (L4_MABX_B.FixPtLogicalOperator_i != 0) {
12853 L4_MABX_B.Init_o = L4_MABX_P.CPV_Value_n;
12854 } else {
12855 L4_MABX_B.Init_o = L4_MABX_B.Xold_d;
12856 }
12857
12858 /* End of Switch: '<S373>/Init' */
12859
12860 /* UnitDelay: '<S374>/FixPt Unit Delay2' */
12861 L4_MABX_B.FixPtUnitDelay2_m = L4_MABX_DW.FixPtUnitDelay2_DSTATE_g;
12862
12863 /* Logic: '<S374>/FixPt Logical Operator' */
12864 L4_MABX_B.FixPtLogicalOperator_b = (uint8_T)(L4_MABX_B.LogicalOperator1_ja ||
12865 (L4_MABX_B.FixPtUnitDelay2_m != 0));
12866
12867 /* UnitDelay: '<S374>/FixPt Unit Delay1' */
12868 L4_MABX_B.Xold_mg = L4_MABX_DW.FixPtUnitDelay1_DSTATE_g;
12869
12870 /* Switch: '<S374>/Init' incorporates:
12871 * Constant: '<S365>/CPV2'
12872 */
12873 if (L4_MABX_B.FixPtLogicalOperator_b != 0) {
12874 L4_MABX_B.Init_lg = L4_MABX_P.CPV2_Value_p;
12875 } else {
12876 L4_MABX_B.Init_lg = L4_MABX_B.Xold_mg;
12877 }
12878
12879 /* End of Switch: '<S374>/Init' */
12880
12881 /* MultiPortSwitch: '<S372>/Multiport Switch' incorporates:
12882 * Constant: '<S365>/CPV2'
12883 * Constant: '<S372>/Integrator_method'
12884 */
12885 switch ((int32_T)L4_MABX_P.Integrator_method_Value) {
12886 case 1:
12887 L4_MABX_B.MultiportSwitch_i = L4_MABX_P.CPV2_Value_p;
12888 break;
12889
12890 case 2:
12891 L4_MABX_B.MultiportSwitch_i = L4_MABX_B.Init_lg;
12892 break;
12893
12894 default:
12895 /* Sum: '<S372>/Add' incorporates:
12896 * Constant: '<S365>/CPV2'
12897 */
12898 L4_MABX_B.Add_py = L4_MABX_B.Init_lg + L4_MABX_P.CPV2_Value_p;
12899
12900 /* Gain: '<S372>/Gain' */
12901 L4_MABX_B.u_trapezoidal = L4_MABX_P.Gain_Gain_j * L4_MABX_B.Add_py;
12902 L4_MABX_B.MultiportSwitch_i = L4_MABX_B.u_trapezoidal;
12903 break;
12904 }
12905
12906 /* End of MultiPortSwitch: '<S372>/Multiport Switch' */
12907
12908 /* DigitalClock: '<S368>/Digital Clock' */
12909 L4_MABX_B.DigitalClock_d = L4_MABX_M->Timing.t[0];
12910
12911 /* UnitDelay: '<S368>/Unit_Delay' */
12912 L4_MABX_B.Unit_Delay_pa = L4_MABX_DW.Unit_Delay_DSTATE_j;
12913
12914 /* Sum: '<S368>/Subtract' */
12915 L4_MABX_B.Subtract_kx = L4_MABX_B.DigitalClock_d - L4_MABX_B.Unit_Delay_pa;
12916
12917 /* Product: '<S367>/Product1' incorporates:
12918 * Constant: '<S365>/CPV'
12919 */
12920 L4_MABX_B.Product1_am = L4_MABX_P.CPV_Value_g * L4_MABX_B.MultiportSwitch_i *
12921 L4_MABX_B.Subtract_kx;
12922
12923 /* Sum: '<S367>/Add' */
12924 L4_MABX_B.Add_db = L4_MABX_B.Init_o + L4_MABX_B.Product1_am;
12925
12926 /* Switch: '<S374>/Reset' incorporates:
12927 * Constant: '<S365>/CPV2'
12928 */
12929 L4_MABX_B.Xnew_f = L4_MABX_P.CPV2_Value_p;
12930
12931 /* Switch: '<S373>/Reset' incorporates:
12932 * Constant: '<S367>/CPV'
12933 */
12934 if (L4_MABX_B.LogicalOperator1_ja) {
12935 L4_MABX_B.Xnew_h = L4_MABX_P.CPV_Value_n;
12936 } else {
12937 L4_MABX_B.Xnew_h = L4_MABX_B.Add_db;
12938 }
12939
12940 /* End of Switch: '<S373>/Reset' */
12941
12942 /* RelationalOperator: '<S381>/min_relop' incorporates:
12943 * Constant: '<S345>/FCW_CTRL_SLEW_INC_APV'
12944 * Constant: '<S381>/min_val'
12945 */
12946 L4_MABX_B.min_relop_c = (L4_MABX_P.CheckStaticLowerBound_min_h <=
12947 L4_MABX_P.FCW_CTRL_SLEW_INC_APV_Value);
12948
12949 /* Assertion: '<S381>/Assertion' */
12950 utAssert(L4_MABX_B.min_relop_c);
12951
12952 /* RelationalOperator: '<S392>/min_relop' incorporates:
12953 * Constant: '<S347>/STABILITY_CTRL_SLEW_INC_APV'
12954 * Constant: '<S392>/min_val'
12955 */
12956 L4_MABX_B.min_relop_f = (L4_MABX_P.CheckStaticLowerBound_min_nz <=
12957 L4_MABX_P.STABILITY_CTRL_SLEW_INC_APV_Val);
12958
12959 /* Assertion: '<S392>/Assertion' */
12960 utAssert(L4_MABX_B.min_relop_f);
12961
12962 /* End of Outputs for SubSystem: '<S65>/Task_10ms' */
12963
12964 /* Outputs for Enabled SubSystem: '<S625>/PosRapidUpdate_011' incorporates:
12965 * EnablePort: '<S626>/Enable'
12966 */
12967 /* Constant: '<S448>/Constant' */
12968 if (L4_MABX_P.Constant_Value_fy > 0.0) {
12969 /* S-Function (rti_commonblock): '<S626>/S-Function1' */
12970 /* This comment workarounds a code generation problem */
12971
12972 /* dSPACE RTICAN RX Message Block: "PosRapidUpdate_01" Id:167248128 */
12973 {
12974 UInt32 *CAN_Msg;
12975 static dsfloat time_old = 0.0;
12976
12977 /* Read status and timestamp info (previous message) */
12978 if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].timestamp !=
12979 time_old) {
12980 /* ... save timestamp info for the calculation of the RX status
12981 during the consecutive sample hit*/
12982 time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].
12983 timestamp;
12984
12985 /* ... set the processed flag to one */
12986 L4_MABX_B.SFunction1_o3_pv = 1.0;
12987 L4_MABX_B.SFunction1_o4_fz = (real_T)
12988 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].timestamp;
12989 L4_MABX_B.SFunction1_o5_i = (real_T)
12990 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].deltatime;
12991 CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80100].data;
12992
12993 /* Decode CAN message */
12994 {
12995 {
12996 rtican_Signal_t CAN_Sgn;
12997
12998 /* ...... "Latitude_" (0|32, standard signal, signed int, little endian) */
12999 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
13000 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
13001 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2];
13002 CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3];
13003 L4_MABX_B.SFunction1_o1_b = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn) );
13004
13005 /* ...... "Longitude_" (32|32, standard signal, signed int, little endian) */
13006 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
13007 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
13008 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6];
13009 CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7];
13010 L4_MABX_B.SFunction1_o2_nv = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn)
13011 );
13012 }
13013 }
13014 } else {
13015 /* set RX status to 0 because no new message has arrived */
13016 L4_MABX_B.SFunction1_o3_pv = 0.0;
13017 }
13018 }
13019 }
13020
13021 /* End of Outputs for SubSystem: '<S625>/PosRapidUpdate_011' */
13022
13023 /* Outputs for Atomic SubSystem: '<S466>/If_Then_Else' */
13024
13025 /* Constant: '<S466>/useGPSSA00' incorporates:
13026 * Constant: '<S466>/useGPSSA0'
13027 */
13028 L4_MABX_If_Then_Else3(L4_MABX_B.LogicalOperator1_c, L4_MABX_P.useGPSSA00_Value,
13029 L4_MABX_P.useGPSSA0_Value, &L4_MABX_B.If_Then_Else);
13030
13031 /* End of Outputs for SubSystem: '<S466>/If_Then_Else' */
13032
13033 /* Outputs for Enabled SubSystem: '<S625>/PosRapidUpdate_1' incorporates:
13034 * EnablePort: '<S627>/Enable'
13035 */
13036 /* Constant: '<S448>/Constant' */
13037 if (L4_MABX_P.Constant_Value_fy > 0.0) {
13038 /* S-Function (rti_commonblock): '<S627>/S-Function1' */
13039 /* This comment workarounds a code generation problem */
13040
13041 /* dSPACE RTICAN RX Message Block: "PosRapidUpdate_01" Id:167248129 */
13042 {
13043 UInt32 *CAN_Msg;
13044 static dsfloat time_old = 0.0;
13045
13046 /* Read status and timestamp info (previous message) */
13047 if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].timestamp !=
13048 time_old) {
13049 /* ... save timestamp info for the calculation of the RX status
13050 during the consecutive sample hit*/
13051 time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].
13052 timestamp;
13053
13054 /* ... set the processed flag to one */
13055 L4_MABX_B.SFunction1_o3_g4 = 1.0;
13056 L4_MABX_B.SFunction1_o4_b = (real_T)
13057 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].timestamp;
13058 L4_MABX_B.SFunction1_o5_g = (real_T)
13059 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].deltatime;
13060 CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80101].data;
13061
13062 /* Decode CAN message */
13063 {
13064 {
13065 rtican_Signal_t CAN_Sgn;
13066
13067 /* ...... "Latitude_" (0|32, standard signal, signed int, little endian) */
13068 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
13069 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
13070 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[2];
13071 CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[3];
13072 L4_MABX_B.SFunction1_o1_po = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn)
13073 );
13074
13075 /* ...... "Longitude_" (32|32, standard signal, signed int, little endian) */
13076 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
13077 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
13078 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6];
13079 CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7];
13080 L4_MABX_B.SFunction1_o2_bc = 1.0E-7 * ( ((real_T) CAN_Sgn.SignedSgn)
13081 );
13082 }
13083 }
13084 } else {
13085 /* set RX status to 0 because no new message has arrived */
13086 L4_MABX_B.SFunction1_o3_g4 = 0.0;
13087 }
13088 }
13089 }
13090
13091 /* End of Outputs for SubSystem: '<S625>/PosRapidUpdate_1' */
13092
13093 /* Switch: '<S625>/Switch' */
13094 if (L4_MABX_B.If_Then_Else.Switch) {
13095 L4_MABX_B.Latitude_ = L4_MABX_B.SFunction1_o1_b;
13096 L4_MABX_B.Longitude_ = L4_MABX_B.SFunction1_o2_nv;
13097 } else {
13098 L4_MABX_B.Latitude_ = L4_MABX_B.SFunction1_o1_po;
13099 L4_MABX_B.Longitude_ = L4_MABX_B.SFunction1_o2_bc;
13100 }
13101
13102 /* Outputs for Enabled SubSystem: '<S505>/CCVS1_00' incorporates:
13103 * EnablePort: '<S506>/Enable'
13104 */
13105 /* Constant: '<S429>/Constant' */
13106 if (L4_MABX_P.Constant_Value_jq) {
13107 /* S-Function (rti_commonblock): '<S506>/S-Function1' */
13108 /* This comment workarounds a code generation problem */
13109
13110 /* dSPACE RTICAN RX Message Block: "CCVS1_00" Id:218034432 */
13111 {
13112 UInt32 *CAN_Msg;
13113 static dsfloat time_old = 0.0;
13114
13115 /* Read status and timestamp info (previous message) */
13116 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].timestamp !=
13117 time_old) {
13118 /* ... save timestamp info for the calculation of the RX status
13119 during the consecutive sample hit*/
13120 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].
13121 timestamp;
13122
13123 /* ... set the processed flag to one */
13124 L4_MABX_B.SFunction1_o21_c = 1.0;
13125 L4_MABX_B.SFunction1_o22_og = (real_T)
13126 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].timestamp;
13127 L4_MABX_B.SFunction1_o23_a = (real_T)
13128 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].deltatime;
13129 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCFEF100].data;
13130
13131 /* Decode CAN message */
13132 {
13133 {
13134 rtican_Signal_t CAN_Sgn;
13135
13136 /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */
13137 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
13138 CAN_Sgn.UnsignedSgn &= 0x00000003;
13139 L4_MABX_B.SFunction1_o1_fl = ((real_T) CAN_Sgn.UnsignedSgn);
13140
13141 /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */
13142 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
13143 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
13144 CAN_Sgn.UnsignedSgn &= 0x00000003;
13145 L4_MABX_B.SFunction1_o2_bu = ((real_T) CAN_Sgn.UnsignedSgn);
13146
13147 /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */
13148 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
13149 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
13150 CAN_Sgn.UnsignedSgn &= 0x00000003;
13151 L4_MABX_B.SFunction1_o3_ko = ((real_T) CAN_Sgn.UnsignedSgn);
13152
13153 /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */
13154 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
13155 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
13156 CAN_Sgn.UnsignedSgn &= 0x00000003;
13157 L4_MABX_B.SFunction1_o4_kv = ((real_T) CAN_Sgn.UnsignedSgn);
13158
13159 /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */
13160 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
13161 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
13162 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
13163 WheelBasedVehicleSpeed = 0.00390625 * ( ((real_T)
13164 CAN_Sgn.UnsignedSgn) );
13165
13166 /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */
13167 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
13168 CAN_Sgn.UnsignedSgn &= 0x00000003;
13169 L4_MABX_B.SFunction1_o6_mm = ((real_T) CAN_Sgn.UnsignedSgn);
13170
13171 /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */
13172 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
13173 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
13174 CAN_Sgn.UnsignedSgn &= 0x00000003;
13175 L4_MABX_B.SFunction1_o7_m1 = ((real_T) CAN_Sgn.UnsignedSgn);
13176
13177 /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */
13178 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
13179 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
13180 CAN_Sgn.UnsignedSgn &= 0x00000003;
13181 BrakeSwitch = ((real_T) CAN_Sgn.UnsignedSgn);
13182
13183 /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */
13184 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
13185 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
13186 CAN_Sgn.UnsignedSgn &= 0x00000003;
13187 L4_MABX_B.SFunction1_o9_py = ((real_T) CAN_Sgn.UnsignedSgn);
13188
13189 /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */
13190 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
13191 CAN_Sgn.UnsignedSgn &= 0x00000003;
13192 L4_MABX_B.SFunction1_o10_a = ((real_T) CAN_Sgn.UnsignedSgn);
13193
13194 /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */
13195 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
13196 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
13197 CAN_Sgn.UnsignedSgn &= 0x00000003;
13198 L4_MABX_B.SFunction1_o11_mi = ((real_T) CAN_Sgn.UnsignedSgn);
13199
13200 /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */
13201 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
13202 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
13203 CAN_Sgn.UnsignedSgn &= 0x00000003;
13204 L4_MABX_B.SFunction1_o12_k = ((real_T) CAN_Sgn.UnsignedSgn);
13205
13206 /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */
13207 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
13208 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
13209 CAN_Sgn.UnsignedSgn &= 0x00000003;
13210 L4_MABX_B.SFunction1_o13_gj = ((real_T) CAN_Sgn.UnsignedSgn);
13211
13212 /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */
13213 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
13214 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13215 L4_MABX_B.SFunction1_o14_e = ((real_T) CAN_Sgn.UnsignedSgn);
13216
13217 /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */
13218 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
13219 CAN_Sgn.UnsignedSgn &= 0x0000001F;
13220 L4_MABX_B.SFunction1_o15_pj = ((real_T) CAN_Sgn.UnsignedSgn);
13221
13222 /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */
13223 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
13224 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 5;
13225 CAN_Sgn.UnsignedSgn &= 0x00000007;
13226 L4_MABX_B.SFunction1_o16_g = ((real_T) CAN_Sgn.UnsignedSgn);
13227
13228 /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */
13229 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
13230 CAN_Sgn.UnsignedSgn &= 0x00000003;
13231 L4_MABX_B.SFunction1_o17_k = ((real_T) CAN_Sgn.UnsignedSgn);
13232
13233 /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */
13234 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
13235 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
13236 CAN_Sgn.UnsignedSgn &= 0x00000003;
13237 L4_MABX_B.SFunction1_o18_e = ((real_T) CAN_Sgn.UnsignedSgn);
13238
13239 /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */
13240 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
13241 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
13242 CAN_Sgn.UnsignedSgn &= 0x00000003;
13243 L4_MABX_B.SFunction1_o19_a = ((real_T) CAN_Sgn.UnsignedSgn);
13244
13245 /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */
13246 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
13247 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
13248 CAN_Sgn.UnsignedSgn &= 0x00000003;
13249 L4_MABX_B.SFunction1_o20_f = ((real_T) CAN_Sgn.UnsignedSgn);
13250 }
13251 }
13252 } else {
13253 /* set RX status to 0 because no new message has arrived */
13254 L4_MABX_B.SFunction1_o21_c = 0.0;
13255 }
13256 }
13257 }
13258
13259 /* End of Constant: '<S429>/Constant' */
13260 /* End of Outputs for SubSystem: '<S505>/CCVS1_00' */
13261
13262 /* Outputs for Enabled SubSystem: '<S509>/COGSOGRapidUpdate_00' incorporates:
13263 * EnablePort: '<S510>/Enable'
13264 */
13265 /* Constant: '<S431>/Constant' */
13266 if (L4_MABX_P.Constant_Value_lf > 0.0) {
13267 /* S-Function (rti_commonblock): '<S510>/S-Function1' */
13268 /* This comment workarounds a code generation problem */
13269
13270 /* dSPACE RTICAN RX Message Block: "COGSOGRapidUpdate_00" Id:167248384 */
13271 {
13272 UInt32 *CAN_Msg;
13273 static dsfloat time_old = 0.0;
13274
13275 /* Read status and timestamp info (previous message) */
13276 if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].timestamp !=
13277 time_old) {
13278 /* ... save timestamp info for the calculation of the RX status
13279 during the consecutive sample hit*/
13280 time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].
13281 timestamp;
13282
13283 /* ... set the processed flag to one */
13284 L4_MABX_B.SFunction1_o5_ly = 1.0;
13285 L4_MABX_B.SFunction1_o6_hp = (real_T)
13286 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].timestamp;
13287 L4_MABX_B.SFunction1_o7_ol = (real_T)
13288 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].deltatime;
13289 CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80200].data;
13290
13291 /* Decode CAN message */
13292 {
13293 {
13294 rtican_Signal_t CAN_Sgn;
13295
13296 /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */
13297 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
13298 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13299 L4_MABX_B.SFunction1_o1_c5 = ((real_T) CAN_Sgn.UnsignedSgn);
13300
13301 /* ...... "COGReference" (8|2, standard signal, unsigned int, little endian) */
13302 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
13303 CAN_Sgn.UnsignedSgn &= 0x00000003;
13304 L4_MABX_B.SFunction1_o2_dq = ((real_T) CAN_Sgn.UnsignedSgn);
13305
13306 /* ...... "CourseOverGround" (16|16, standard signal, unsigned int, little endian) */
13307 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
13308 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
13309 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
13310 L4_MABX_B.SFunction1_o3_hj = 0.0001 * ( ((real_T)
13311 CAN_Sgn.UnsignedSgn) );
13312
13313 /* ...... "SpeedOverGround" (32|16, standard signal, unsigned int, little endian) */
13314 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
13315 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
13316 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
13317 L4_MABX_B.SFunction1_o4_gu = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
13318 );
13319 }
13320 }
13321 } else {
13322 /* set RX status to 0 because no new message has arrived */
13323 L4_MABX_B.SFunction1_o5_ly = 0.0;
13324 }
13325 }
13326 }
13327
13328 /* End of Outputs for SubSystem: '<S509>/COGSOGRapidUpdate_00' */
13329
13330 /* DataTypeConversion: '<S509>/Data Type Conversion8' */
13331 L4_MABX_B.RX_status_es = (L4_MABX_B.SFunction1_o5_ly != 0.0);
13332
13333 /* Outputs for Enabled SubSystem: '<S509>/COGSOGRapidUpdate_1' incorporates:
13334 * EnablePort: '<S511>/Enable'
13335 */
13336 /* Constant: '<S431>/Constant' */
13337 if (L4_MABX_P.Constant_Value_lf > 0.0) {
13338 /* S-Function (rti_commonblock): '<S511>/S-Function1' */
13339 /* This comment workarounds a code generation problem */
13340
13341 /* dSPACE RTICAN RX Message Block: "COGSOGRapidUpdate_00" Id:167248385 */
13342 {
13343 UInt32 *CAN_Msg;
13344 static dsfloat time_old = 0.0;
13345
13346 /* Read status and timestamp info (previous message) */
13347 if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].timestamp !=
13348 time_old) {
13349 /* ... save timestamp info for the calculation of the RX status
13350 during the consecutive sample hit*/
13351 time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].
13352 timestamp;
13353
13354 /* ... set the processed flag to one */
13355 L4_MABX_B.SFunction1_o5_lq = 1.0;
13356 L4_MABX_B.SFunction1_o6_fk = (real_T)
13357 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].timestamp;
13358 L4_MABX_B.SFunction1_o7_i = (real_T)
13359 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].deltatime;
13360 CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x9F80201].data;
13361
13362 /* Decode CAN message */
13363 {
13364 {
13365 rtican_Signal_t CAN_Sgn;
13366
13367 /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */
13368 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
13369 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13370 L4_MABX_B.SFunction1_o1_ieu = ((real_T) CAN_Sgn.UnsignedSgn);
13371
13372 /* ...... "COGReference" (8|2, standard signal, unsigned int, little endian) */
13373 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
13374 CAN_Sgn.UnsignedSgn &= 0x00000003;
13375 L4_MABX_B.SFunction1_o2_bf = ((real_T) CAN_Sgn.UnsignedSgn);
13376
13377 /* ...... "CourseOverGround" (16|16, standard signal, unsigned int, little endian) */
13378 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
13379 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
13380 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
13381 L4_MABX_B.SFunction1_o3_er = 0.0001 * ( ((real_T)
13382 CAN_Sgn.UnsignedSgn) );
13383
13384 /* ...... "SpeedOverGround" (32|16, standard signal, unsigned int, little endian) */
13385 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
13386 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
13387 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
13388 L4_MABX_B.SFunction1_o4_ik = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
13389 );
13390 }
13391 }
13392 } else {
13393 /* set RX status to 0 because no new message has arrived */
13394 L4_MABX_B.SFunction1_o5_lq = 0.0;
13395 }
13396 }
13397 }
13398
13399 /* End of Outputs for SubSystem: '<S509>/COGSOGRapidUpdate_1' */
13400
13401 /* Switch: '<S509>/Switch' */
13402 if (L4_MABX_B.RX_status_es) {
13403 L4_MABX_B.SID = L4_MABX_B.SFunction1_o1_c5;
13404 L4_MABX_B.COGReference = L4_MABX_B.SFunction1_o2_dq;
13405 L4_MABX_B.CourseOverGround = L4_MABX_B.SFunction1_o3_hj;
13406 L4_MABX_B.SpeedOverGround = L4_MABX_B.SFunction1_o4_gu;
13407 } else {
13408 L4_MABX_B.SID = L4_MABX_B.SFunction1_o1_ieu;
13409 L4_MABX_B.COGReference = L4_MABX_B.SFunction1_o2_bf;
13410 L4_MABX_B.CourseOverGround = L4_MABX_B.SFunction1_o3_er;
13411 L4_MABX_B.SpeedOverGround = L4_MABX_B.SFunction1_o4_ik;
13412 }
13413
13414 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_100ms' */
13415
13416 /* RateTransition: '<S886>/TmpRTBAtHiddenBuf_InsertedFor_Rolling_15_counter_at_inport_0Inport1' */
13417 if (L4_MABX_M->Timing.RateInteraction.TID0_3 == 1) {
13418 L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_R = AutonomousOutputEnabled;
13419
13420 /* RateTransition: '<S904>/TmpRTBAtOperatorInport1' */
13421 L4_MABX_B.TmpRTBAtOperatorInport1 = AutonomousOutputEnabled;
13422
13423 /* RateTransition: '<S907>/TmpRTBAtOperatorInport1' */
13424 L4_MABX_B.TmpRTBAtOperatorInport1_o = AutonomousOutputEnabled;
13425
13426 /* RateTransition: '<S898>/TmpRTBAtOperatorInport1' */
13427 L4_MABX_B.TmpRTBAtOperatorInport1_f = AutonomousOutputEnabled;
13428
13429 /* RateTransition: '<S899>/TmpRTBAtOperatorInport1' */
13430 L4_MABX_B.TmpRTBAtOperatorInport1_h = AutonomousOutputEnabled;
13431
13432 /* RateTransition: '<S905>/TmpRTBAtOperatorInport1' */
13433 L4_MABX_B.TmpRTBAtOperatorInport1_c = AutonomousOutputEnabled;
13434
13435 /* RateTransition: '<S906>/TmpRTBAtOperatorInport1' */
13436 L4_MABX_B.TmpRTBAtOperatorInport1_oe = AutonomousOutputEnabled;
13437 L4_MABX_B.Latitude__j = L4_MABX_B.Latitude_;
13438 L4_MABX_B.Longitude__g = L4_MABX_B.Longitude_;
13439 L4_MABX_B.TwoSpeedAxleSwitch_l = L4_MABX_B.SFunction1_o1_fl;
13440 L4_MABX_B.ParkingBrakeSwitch_h = L4_MABX_B.SFunction1_o2_bu;
13441 L4_MABX_B.CruiseCtrlPauseSwitch_h = L4_MABX_B.SFunction1_o3_ko;
13442 L4_MABX_B.ParkBrakeReleaseInhibitRq_c = L4_MABX_B.SFunction1_o4_kv;
13443 L4_MABX_B.WheelBasedVehicleSpeed_jj = WheelBasedVehicleSpeed;
13444 L4_MABX_B.CruiseCtrlActive_n = L4_MABX_B.SFunction1_o6_mm;
13445 L4_MABX_B.CruiseCtrlEnableSwitch_ii = L4_MABX_B.SFunction1_o7_m1;
13446 L4_MABX_B.BrakeSwitch_mq = BrakeSwitch;
13447 L4_MABX_B.ClutchSwitch_i = L4_MABX_B.SFunction1_o9_py;
13448 L4_MABX_B.CruiseCtrlSetSwitch_l = L4_MABX_B.SFunction1_o10_a;
13449 L4_MABX_B.CruiseCtrlCoastSwitch_f = L4_MABX_B.SFunction1_o11_mi;
13450 L4_MABX_B.CruiseCtrlResumeSwitch_l = L4_MABX_B.SFunction1_o12_k;
13451 L4_MABX_B.CruiseCtrlAccelerateSwitch_c = L4_MABX_B.SFunction1_o13_gj;
13452 L4_MABX_B.CruiseCtrlSetSpeed_j = L4_MABX_B.SFunction1_o14_e;
13453 L4_MABX_B.PTOGovernorState_m = L4_MABX_B.SFunction1_o15_pj;
13454 L4_MABX_B.CruiseCtrlStates_c = L4_MABX_B.SFunction1_o16_g;
13455 L4_MABX_B.EngIdleIncrementSwitch_k = L4_MABX_B.SFunction1_o17_k;
13456 L4_MABX_B.EngIdleDecrementSwitch_c = L4_MABX_B.SFunction1_o18_e;
13457 L4_MABX_B.EngTestModeSwitch_f = L4_MABX_B.SFunction1_o19_a;
13458 L4_MABX_B.EngShutdownOverrideSwitch_g = L4_MABX_B.SFunction1_o20_f;
13459 L4_MABX_B.TwoSpeedAxleSwitch_l1 = L4_MABX_B.SFunction1_o1_fl;
13460 L4_MABX_B.ParkingBrakeSwitch_hd = L4_MABX_B.SFunction1_o2_bu;
13461 L4_MABX_B.CruiseCtrlPauseSwitch_hy = L4_MABX_B.SFunction1_o3_ko;
13462 L4_MABX_B.ParkBrakeReleaseInhibitRq_cf = L4_MABX_B.SFunction1_o4_kv;
13463 L4_MABX_B.WheelBasedVehicleSpeed_jjn = WheelBasedVehicleSpeed;
13464 L4_MABX_B.CruiseCtrlActive_ns = L4_MABX_B.SFunction1_o6_mm;
13465 L4_MABX_B.CruiseCtrlEnableSwitch_iim = L4_MABX_B.SFunction1_o7_m1;
13466 L4_MABX_B.BrakeSwitch_mq0 = BrakeSwitch;
13467 L4_MABX_B.ClutchSwitch_ic = L4_MABX_B.SFunction1_o9_py;
13468 L4_MABX_B.CruiseCtrlSetSwitch_lx = L4_MABX_B.SFunction1_o10_a;
13469 L4_MABX_B.CruiseCtrlCoastSwitch_f1 = L4_MABX_B.SFunction1_o11_mi;
13470 L4_MABX_B.CruiseCtrlResumeSwitch_l3 = L4_MABX_B.SFunction1_o12_k;
13471 L4_MABX_B.CruiseCtrlAccelerateSwitch_cw = L4_MABX_B.SFunction1_o13_gj;
13472 L4_MABX_B.CruiseCtrlSetSpeed_jb = L4_MABX_B.SFunction1_o14_e;
13473 L4_MABX_B.PTOGovernorState_mu = L4_MABX_B.SFunction1_o15_pj;
13474 L4_MABX_B.CruiseCtrlStates_cv = L4_MABX_B.SFunction1_o16_g;
13475 L4_MABX_B.EngIdleIncrementSwitch_k0 = L4_MABX_B.SFunction1_o17_k;
13476 L4_MABX_B.EngIdleDecrementSwitch_cv = L4_MABX_B.SFunction1_o18_e;
13477 L4_MABX_B.EngTestModeSwitch_fw = L4_MABX_B.SFunction1_o19_a;
13478 L4_MABX_B.EngShutdownOverrideSwitch_gz = L4_MABX_B.SFunction1_o20_f;
13479 L4_MABX_B.SID_k = L4_MABX_B.SID;
13480 L4_MABX_B.COGReference_k = L4_MABX_B.COGReference;
13481 L4_MABX_B.CourseOverGround_i = L4_MABX_B.CourseOverGround;
13482 L4_MABX_B.SpeedOverGround_l = L4_MABX_B.SpeedOverGround;
13483 L4_MABX_B.ASREngCtrlActive = L4_MABX_B.SFunction1_o1_mb;
13484 L4_MABX_B.ASRBrakeCtrlActive = L4_MABX_B.SFunction1_o2_i1;
13485 L4_MABX_B.AntiLockBrakingActive = L4_MABX_B.SFunction1_o3_ac;
13486 L4_MABX_B.EBSBrakeSwitch_c = L4_MABX_B.SFunction1_o4_oc;
13487 L4_MABX_B.BrakePedalPos = L4_MABX_B.SFunction1_o5_md;
13488 L4_MABX_B.ABSOffroadSwitch = L4_MABX_B.SFunction1_o6_oc;
13489 L4_MABX_B.ASROffroadSwitch = L4_MABX_B.SFunction1_o7_d;
13490 L4_MABX_B.ASRHillHolderSwitch = L4_MABX_B.SFunction1_o8_l1;
13491 L4_MABX_B.TractionCtrlOverrideSwitch = L4_MABX_B.SFunction1_o9_lw;
13492 L4_MABX_B.AccelInterlockSwitch = L4_MABX_B.SFunction1_o10_h;
13493 L4_MABX_B.EngDerateSwitch = L4_MABX_B.SFunction1_o11_ay;
13494 L4_MABX_B.EngAuxShutdownSwitch = L4_MABX_B.SFunction1_o12_j;
13495 L4_MABX_B.RemoteAccelEnableSwitch = L4_MABX_B.SFunction1_o13_gt;
13496 L4_MABX_B.EngRetarderSelection = L4_MABX_B.SFunction1_o14_h;
13497 L4_MABX_B.ABSFullyOperational = L4_MABX_B.SFunction1_o15_k;
13498 L4_MABX_B.EBSRedWarningSignal = L4_MABX_B.SFunction1_o16_l;
13499 L4_MABX_B.ABS_EBSAmberWarningSignal = L4_MABX_B.SFunction1_o17_m;
13500 L4_MABX_B.ATC_ASRInformationSignal = L4_MABX_B.SFunction1_o18_j;
13501 L4_MABX_B.SrcAddrssOfCtrllngDvcFrBrkCntrl = L4_MABX_B.SFunction1_o19_h;
13502 L4_MABX_B.HaltBrakeSwitch = L4_MABX_B.SFunction1_o20_j;
13503 L4_MABX_B.TrailerABSStatus = L4_MABX_B.SFunction1_o21_p;
13504 L4_MABX_B.TrctrMntdTrilerABSWarningSignal = L4_MABX_B.SFunction1_o22_e;
13505 }
13506
13507 /* End of Outputs for SubSystem: '<S849>/CAN_TX_100ms' */
13508
13509 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_10ms' */
13510
13511 /* DataTypeConversion: '<S951>/Data Type Conversion4' */
13512 L4_MABX_B.DataTypeConversion4_f = L4_MABX_B.Diff;
13513
13514 /* DataTypeConversion: '<S940>/Data Type Conversion' incorporates:
13515 * Constant: '<S854>/CANT_ACCS_E4_CHANNEL_APV'
13516 */
13517 L4_MABX_B.DataTypeConversion_o3 = (uint8_T)
13518 L4_MABX_P.CANT_ACCS_E4_CHANNEL_APV_Value;
13519
13520 /* S-Function (sfix_bitop): '<S948>/Operator' */
13521 L4_MABX_B.Operator_as = (uint8_T)(L4_MABX_B.DataTypeConversion_o3 &
13522 L4_MABX_P.Operator_BitMask_cm);
13523
13524 /* DataTypeConversion: '<S948>/DataType' */
13525 L4_MABX_B.DataType_le = L4_MABX_B.Operator_as;
13526
13527 /* ArithShift: '<S940>/Shift_Arithmetic 2' */
13528 L4_MABX_B.Shift_Arithmetic2_h = ldexp(L4_MABX_B.DataType_le, (-3));
13529
13530 /* DataTypeConversion: '<S940>/Data Type Conversion5' */
13531 L4_MABX_B.DataTypeConversion5_h1 = (L4_MABX_B.Shift_Arithmetic2_h != 0.0);
13532
13533 /* Outputs for Enabled SubSystem: '<S951>/ACCS' incorporates:
13534 * EnablePort: '<S952>/Enable'
13535 */
13536 if (L4_MABX_B.DataTypeConversion5_h1) {
13537 /* S-Function (rti_commonblock): '<S952>/S-Function1' */
13538 /* This comment workarounds a code generation problem */
13539
13540 /* dSPACE RTICAN TX Message Block: "ACCS" Id:418393572 */
13541 {
13542 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
13543
13544 Float32 delayTime = 0.0;
13545
13546 /* ... Read status and timestamp info (previous message) */
13547 can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]);
13548
13549 /* Convert timestamp */
13550 if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->processed) {
13551 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp =
13552 rtk_dsts_time_to_simtime_convert
13553 (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp);
13554 }
13555
13556 /* Messages with timestamp zero have been received in pause/stop state
13557 and must not be handled.
13558 */
13559 if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp > 0.0) {
13560 L4_MABX_B.SFunction1_o1_kc = (real_T)
13561 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->processed;
13562 L4_MABX_B.SFunction1_o2_o = (real_T)
13563 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->timestamp;
13564 L4_MABX_B.SFunction1_o3_mw = (real_T)
13565 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->deltatime;
13566 L4_MABX_B.SFunction1_o4_gi = (real_T)
13567 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4]->delaytime;
13568 }
13569
13570 /* ... Encode Simulink signals of TX and RM blocks*/
13571 {
13572 rtican_Signal_t CAN_Sgn;
13573
13574 /* ...... "LongitudinalAccelerationExRange" (16|16, standard signal, unsigned int, little endian) */
13575 /* Add or substract 0.5 in order to round to nearest integer */
13576 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_f -
13577 ( -320 ) ) / 0.01 + 0.5);
13578 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
13579 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
13580 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1;
13581 }
13582
13583 /* mask unused bits with '1' */
13584 CAN_Msg[0] |= 0xFF;
13585 CAN_Msg[1] |= 0xFF;
13586 CAN_Msg[4] |= 0xFF;
13587 CAN_Msg[5] |= 0xFF;
13588 CAN_Msg[6] |= 0xFF;
13589 CAN_Msg[7] |= 0xFF;
13590
13591 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
13592 can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4], 8,
13593 &(CAN_Msg[0]), delayTime);
13594 }
13595 }
13596
13597 /* End of Outputs for SubSystem: '<S951>/ACCS' */
13598
13599 /* S-Function (sfix_bitop): '<S945>/Operator' */
13600 L4_MABX_B.Operator_fw = (uint8_T)(L4_MABX_B.DataTypeConversion_o3 &
13601 L4_MABX_P.Operator_BitMask_gs);
13602
13603 /* DataTypeConversion: '<S945>/DataType' */
13604 L4_MABX_B.DataType_er = L4_MABX_B.Operator_fw;
13605
13606 /* S-Function (sfix_bitop): '<S946>/Operator' */
13607 L4_MABX_B.Operator_bv = (uint8_T)(L4_MABX_B.DataTypeConversion_o3 &
13608 L4_MABX_P.Operator_BitMask_bh);
13609
13610 /* DataTypeConversion: '<S946>/DataType' */
13611 L4_MABX_B.DataType_ly = L4_MABX_B.Operator_bv;
13612
13613 /* S-Function (sfix_bitop): '<S947>/Operator' */
13614 L4_MABX_B.Operator_fj = (uint8_T)(L4_MABX_B.DataTypeConversion_o3 &
13615 L4_MABX_P.Operator_BitMask_i);
13616
13617 /* DataTypeConversion: '<S947>/DataType' */
13618 L4_MABX_B.DataType_c = L4_MABX_B.Operator_fj;
13619
13620 /* S-Function (sfix_bitop): '<S949>/Operator' */
13621 L4_MABX_B.Operator_jb = (uint8_T)(L4_MABX_B.DataTypeConversion_o3 &
13622 L4_MABX_P.Operator_BitMask_p);
13623
13624 /* DataTypeConversion: '<S949>/DataType' */
13625 L4_MABX_B.DataType_b = L4_MABX_B.Operator_jb;
13626
13627 /* S-Function (sfix_bitop): '<S950>/Operator' */
13628 L4_MABX_B.Operator_oo = (uint8_T)(L4_MABX_B.DataTypeConversion_o3 &
13629 L4_MABX_P.Operator_BitMask_nq);
13630
13631 /* DataTypeConversion: '<S950>/DataType' */
13632 L4_MABX_B.DataType_ny = L4_MABX_B.Operator_oo;
13633
13634 /* DataTypeConversion: '<S940>/Data Type Conversion2' */
13635 L4_MABX_B.DataTypeConversion2_dr = (L4_MABX_B.DataType_er != 0);
13636
13637 /* ArithShift: '<S940>/Shift_Arithmetic ' */
13638 L4_MABX_B.Shift_Arithmetic_e = ldexp(L4_MABX_B.DataType_ly, (-1));
13639
13640 /* DataTypeConversion: '<S940>/Data Type Conversion3' */
13641 L4_MABX_B.DataTypeConversion3_on = (L4_MABX_B.Shift_Arithmetic_e != 0.0);
13642
13643 /* ArithShift: '<S940>/Shift_Arithmetic 1' */
13644 L4_MABX_B.Shift_Arithmetic1_p = ldexp(L4_MABX_B.DataType_c, (-2));
13645
13646 /* DataTypeConversion: '<S940>/Data Type Conversion4' */
13647 L4_MABX_B.DataTypeConversion4_jb = (L4_MABX_B.Shift_Arithmetic1_p != 0.0);
13648
13649 /* ArithShift: '<S940>/Shift_Arithmetic 3' */
13650 L4_MABX_B.Shift_Arithmetic3_p = ldexp(L4_MABX_B.DataType_b, (-4));
13651
13652 /* DataTypeConversion: '<S940>/Data Type Conversion6' */
13653 L4_MABX_B.DataTypeConversion6_cx = (L4_MABX_B.Shift_Arithmetic3_p != 0.0);
13654
13655 /* ArithShift: '<S940>/Shift_Arithmetic 4' */
13656 L4_MABX_B.Shift_Arithmetic4_o = ldexp(L4_MABX_B.DataType_ny, (-5));
13657
13658 /* DataTypeConversion: '<S940>/Data Type Conversion7' */
13659 L4_MABX_B.DataTypeConversion7_jm = (L4_MABX_B.Shift_Arithmetic4_o != 0.0);
13660
13661 /* DataTypeConversion: '<S959>/Data Type Conversion1' */
13662 L4_MABX_B.DataTypeConversion1_ce = L4_MABX_B.SFunction1_o2_a4;
13663
13664 /* DataTypeConversion: '<S959>/Data Type Conversion2' */
13665 L4_MABX_B.DataTypeConversion2_p4 = L4_MABX_B.SFunction1_o3_ob;
13666
13667 /* DataTypeConversion: '<S959>/Data Type Conversion3' */
13668 L4_MABX_B.DataTypeConversion3_e = L4_MABX_B.SFunction1_o4_jr;
13669
13670 /* DataTypeConversion: '<S959>/Data Type Conversion4' */
13671 L4_MABX_B.DataTypeConversion4_g = L4_MABX_B.SFunction1_o1_mp;
13672
13673 /* DataTypeConversion: '<S959>/Data Type Conversion5' */
13674 L4_MABX_B.DataTypeConversion5_a = L4_MABX_B.SFunction1_o5_en;
13675
13676 /* DataTypeConversion: '<S959>/Data Type Conversion6' */
13677 L4_MABX_B.DataTypeConversion6_p = L4_MABX_B.SFunction1_o6_cv;
13678
13679 /* DataTypeConversion: '<S959>/Data Type Conversion7' */
13680 L4_MABX_B.DataTypeConversion7_n = L4_MABX_B.SFunction1_o7_ny;
13681
13682 /* DataTypeConversion: '<S959>/Data Type Conversion8' */
13683 L4_MABX_B.DataTypeConversion8_a = L4_MABX_B.SFunction1_o8_ab;
13684
13685 /* DataTypeConversion: '<S941>/Data Type Conversion' incorporates:
13686 * Constant: '<S854>/CANT_EEC1_00_CHANNEL_APV'
13687 */
13688 L4_MABX_B.DataTypeConversion_p3 = (uint8_T)
13689 L4_MABX_P.CANT_EEC1_00_CHANNEL_APV_Value;
13690
13691 /* S-Function (sfix_bitop): '<S956>/Operator' */
13692 L4_MABX_B.Operator_au = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 &
13693 L4_MABX_P.Operator_BitMask_pm);
13694
13695 /* DataTypeConversion: '<S956>/DataType' */
13696 L4_MABX_B.DataType_m = L4_MABX_B.Operator_au;
13697
13698 /* ArithShift: '<S941>/Shift_Arithmetic 2' */
13699 L4_MABX_B.Shift_Arithmetic2_o = ldexp(L4_MABX_B.DataType_m, (-3));
13700
13701 /* DataTypeConversion: '<S941>/Data Type Conversion5' */
13702 L4_MABX_B.DataTypeConversion5_il = (L4_MABX_B.Shift_Arithmetic2_o != 0.0);
13703
13704 /* Outputs for Enabled SubSystem: '<S959>/EEC1_00' incorporates:
13705 * EnablePort: '<S961>/Enable'
13706 */
13707 if (L4_MABX_B.DataTypeConversion5_il) {
13708 /* S-Function (rti_commonblock): '<S961>/S-Function1' */
13709 /* This comment workarounds a code generation problem */
13710
13711 /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */
13712 {
13713 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
13714
13715 Float32 delayTime = 0.0;
13716
13717 /* ... Read status and timestamp info (previous message) */
13718 can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]);
13719
13720 /* Convert timestamp */
13721 if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->processed) {
13722 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp =
13723 rtk_dsts_time_to_simtime_convert
13724 (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp);
13725 }
13726
13727 /* Messages with timestamp zero have been received in pause/stop state
13728 and must not be handled.
13729 */
13730 if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp > 0.0) {
13731 L4_MABX_B.SFunction1_o1_ky = (real_T)
13732 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->processed;
13733 L4_MABX_B.SFunction1_o2_l = (real_T)
13734 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->timestamp;
13735 L4_MABX_B.SFunction1_o3_p = (real_T)
13736 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->deltatime;
13737 L4_MABX_B.SFunction1_o4_ek = (real_T)
13738 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400]->delaytime;
13739 }
13740
13741 /* ... Encode Simulink signals of TX and RM blocks*/
13742 {
13743 rtican_Signal_t CAN_Sgn;
13744
13745 /* ...... "SPN899_EngineTorqueMode" (0|4, standard signal, unsigned int, little endian) */
13746 /* Add or substract 0.5 in order to round to nearest integer */
13747 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_g ) +
13748 0.5);
13749 CAN_Sgn.UnsignedSgn &= 0x0000000F;
13750 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
13751
13752 /* ...... "SPN4154_ActEngPercTorqueFrac" (4|4, standard signal, unsigned int, little endian) */
13753 /* Add or substract 0.5 in order to round to nearest integer */
13754 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ce - ( 0
13755 ) ) / 0.125 + 0.5);
13756 CAN_Sgn.UnsignedSgn &= 0x0000000F;
13757 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
13758 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
13759
13760 /* ...... "SPN512_DrvrDemEngPercTrq" (8|8, standard signal, unsigned int, little endian) */
13761 /* Add or substract 0.5 in order to round to nearest integer */
13762 CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion2_p4 -
13763 ( -125 ) + 0.5);
13764 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13765 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
13766
13767 /* ...... "SPN513_ActEngPercTorque" (16|8, standard signal, unsigned int, little endian) */
13768 /* Add or substract 0.5 in order to round to nearest integer */
13769 CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion3_e - ( -125
13770 ) + 0.5);
13771 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13772 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
13773
13774 /* ...... "SPN190_EngineSpeed" (24|16, standard signal, unsigned int, little endian) */
13775 /* Add or substract 0.5 in order to round to nearest integer */
13776 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion5_a - ( 0 )
13777 ) / 0.125 + 0.5);
13778 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
13779 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
13780 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1;
13781
13782 /* ...... "SPN1483_SAOfCtrlDevForEngineCtrl" (40|8, standard signal, unsigned int, little endian) */
13783 /* Add or substract 0.5 in order to round to nearest integer */
13784 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion6_p ) +
13785 0.5);
13786 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13787 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
13788
13789 /* ...... "SPN1675_EngineStarterMode" (48|4, standard signal, unsigned int, little endian) */
13790 /* Add or substract 0.5 in order to round to nearest integer */
13791 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion7_n ) +
13792 0.5);
13793 CAN_Sgn.UnsignedSgn &= 0x0000000F;
13794 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
13795
13796 /* ...... "SPN2432_EngDemPercTrq" (56|8, standard signal, unsigned int, little endian) */
13797 /* Add or substract 0.5 in order to round to nearest integer */
13798 CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion8_a - ( -125
13799 ) + 0.5);
13800 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13801 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
13802 }
13803
13804 /* mask unused bits with '1' */
13805 CAN_Msg[6] |= 0xF0;
13806
13807 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
13808 can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400], 8,
13809 &(CAN_Msg[0]), delayTime);
13810 }
13811 }
13812
13813 /* End of Outputs for SubSystem: '<S959>/EEC1_00' */
13814
13815 /* DataTypeConversion: '<S960>/Data Type Conversion1' */
13816 L4_MABX_B.DataTypeConversion1_o = L4_MABX_B.SFunction1_o2_a4;
13817
13818 /* DataTypeConversion: '<S960>/Data Type Conversion2' */
13819 L4_MABX_B.DataTypeConversion2_ew = L4_MABX_B.SFunction1_o3_ob;
13820
13821 /* DataTypeConversion: '<S960>/Data Type Conversion3' */
13822 L4_MABX_B.DataTypeConversion3_j = L4_MABX_B.SFunction1_o4_jr;
13823
13824 /* DataTypeConversion: '<S960>/Data Type Conversion4' */
13825 L4_MABX_B.DataTypeConversion4_a = L4_MABX_B.SFunction1_o1_mp;
13826
13827 /* DataTypeConversion: '<S960>/Data Type Conversion5' */
13828 L4_MABX_B.DataTypeConversion5_f = L4_MABX_B.SFunction1_o5_en;
13829
13830 /* DataTypeConversion: '<S960>/Data Type Conversion6' */
13831 L4_MABX_B.DataTypeConversion6_g = L4_MABX_B.SFunction1_o6_cv;
13832
13833 /* DataTypeConversion: '<S960>/Data Type Conversion7' */
13834 L4_MABX_B.DataTypeConversion7_e = L4_MABX_B.SFunction1_o7_ny;
13835
13836 /* DataTypeConversion: '<S960>/Data Type Conversion8' */
13837 L4_MABX_B.DataTypeConversion8_f = L4_MABX_B.SFunction1_o8_ab;
13838
13839 /* S-Function (sfix_bitop): '<S957>/Operator' */
13840 L4_MABX_B.Operator_hc = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 &
13841 L4_MABX_P.Operator_BitMask_od);
13842
13843 /* DataTypeConversion: '<S957>/DataType' */
13844 L4_MABX_B.DataType_h = L4_MABX_B.Operator_hc;
13845
13846 /* ArithShift: '<S941>/Shift_Arithmetic 3' */
13847 L4_MABX_B.Shift_Arithmetic3_i = ldexp(L4_MABX_B.DataType_h, (-4));
13848
13849 /* DataTypeConversion: '<S941>/Data Type Conversion6' */
13850 L4_MABX_B.DataTypeConversion6_ly = (L4_MABX_B.Shift_Arithmetic3_i != 0.0);
13851
13852 /* Outputs for Enabled SubSystem: '<S960>/EEC1_00' incorporates:
13853 * EnablePort: '<S962>/Enable'
13854 */
13855 if (L4_MABX_B.DataTypeConversion6_ly) {
13856 /* S-Function (rti_commonblock): '<S962>/S-Function1' */
13857 /* This comment workarounds a code generation problem */
13858
13859 /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */
13860 {
13861 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
13862
13863 Float32 delayTime = 0.0;
13864
13865 /* ... Read status and timestamp info (previous message) */
13866 can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]);
13867
13868 /* Convert timestamp */
13869 if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->processed) {
13870 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp =
13871 rtk_dsts_time_to_simtime_convert
13872 (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp);
13873 }
13874
13875 /* Messages with timestamp zero have been received in pause/stop state
13876 and must not be handled.
13877 */
13878 if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp > 0.0) {
13879 L4_MABX_B.SFunction1_o1_l = (real_T)
13880 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->processed;
13881 L4_MABX_B.SFunction1_o2_jq = (real_T)
13882 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->timestamp;
13883 L4_MABX_B.SFunction1_o3_nn = (real_T)
13884 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->deltatime;
13885 L4_MABX_B.SFunction1_o4_g3 = (real_T)
13886 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400]->delaytime;
13887 }
13888
13889 /* ... Encode Simulink signals of TX and RM blocks*/
13890 {
13891 rtican_Signal_t CAN_Sgn;
13892
13893 /* ...... "SPN899_EngineTorqueMode" (0|4, standard signal, unsigned int, little endian) */
13894 /* Add or substract 0.5 in order to round to nearest integer */
13895 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_a ) +
13896 0.5);
13897 CAN_Sgn.UnsignedSgn &= 0x0000000F;
13898 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
13899
13900 /* ...... "SPN4154_ActEngPercTorqueFrac" (4|4, standard signal, unsigned int, little endian) */
13901 /* Add or substract 0.5 in order to round to nearest integer */
13902 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_o - ( 0 )
13903 ) / 0.125 + 0.5);
13904 CAN_Sgn.UnsignedSgn &= 0x0000000F;
13905 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
13906 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
13907
13908 /* ...... "SPN512_DrvrDemEngPercTrq" (8|8, standard signal, unsigned int, little endian) */
13909 /* Add or substract 0.5 in order to round to nearest integer */
13910 CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion2_ew -
13911 ( -125 ) + 0.5);
13912 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13913 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
13914
13915 /* ...... "SPN513_ActEngPercTorque" (16|8, standard signal, unsigned int, little endian) */
13916 /* Add or substract 0.5 in order to round to nearest integer */
13917 CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion3_j - ( -125
13918 ) + 0.5);
13919 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13920 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
13921
13922 /* ...... "SPN190_EngineSpeed" (24|16, standard signal, unsigned int, little endian) */
13923 /* Add or substract 0.5 in order to round to nearest integer */
13924 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion5_f - ( 0 )
13925 ) / 0.125 + 0.5);
13926 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
13927 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
13928 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1;
13929
13930 /* ...... "SPN1483_SAOfCtrlDevForEngineCtrl" (40|8, standard signal, unsigned int, little endian) */
13931 /* Add or substract 0.5 in order to round to nearest integer */
13932 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion6_g ) +
13933 0.5);
13934 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13935 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
13936
13937 /* ...... "SPN1675_EngineStarterMode" (48|4, standard signal, unsigned int, little endian) */
13938 /* Add or substract 0.5 in order to round to nearest integer */
13939 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion7_e ) +
13940 0.5);
13941 CAN_Sgn.UnsignedSgn &= 0x0000000F;
13942 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
13943
13944 /* ...... "SPN2432_EngDemPercTrq" (56|8, standard signal, unsigned int, little endian) */
13945 /* Add or substract 0.5 in order to round to nearest integer */
13946 CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.DataTypeConversion8_f - ( -125
13947 ) + 0.5);
13948 CAN_Sgn.UnsignedSgn &= 0x000000FF;
13949 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
13950 }
13951
13952 /* mask unused bits with '1' */
13953 CAN_Msg[6] |= 0xF0;
13954
13955 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
13956 can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400], 8,
13957 &(CAN_Msg[0]), delayTime);
13958 }
13959 }
13960
13961 /* End of Outputs for SubSystem: '<S960>/EEC1_00' */
13962
13963 /* S-Function (sfix_bitop): '<S953>/Operator' */
13964 L4_MABX_B.Operator_ery = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 &
13965 L4_MABX_P.Operator_BitMask_dl);
13966
13967 /* DataTypeConversion: '<S953>/DataType' */
13968 L4_MABX_B.DataType_co = L4_MABX_B.Operator_ery;
13969
13970 /* S-Function (sfix_bitop): '<S954>/Operator' */
13971 L4_MABX_B.Operator_li = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 &
13972 L4_MABX_P.Operator_BitMask_hq);
13973
13974 /* DataTypeConversion: '<S954>/DataType' */
13975 L4_MABX_B.DataType_bi = L4_MABX_B.Operator_li;
13976
13977 /* S-Function (sfix_bitop): '<S955>/Operator' */
13978 L4_MABX_B.Operator_gwa = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 &
13979 L4_MABX_P.Operator_BitMask_ob);
13980
13981 /* DataTypeConversion: '<S955>/DataType' */
13982 L4_MABX_B.DataType_o = L4_MABX_B.Operator_gwa;
13983
13984 /* S-Function (sfix_bitop): '<S958>/Operator' */
13985 L4_MABX_B.Operator_aup = (uint8_T)(L4_MABX_B.DataTypeConversion_p3 &
13986 L4_MABX_P.Operator_BitMask_cx);
13987
13988 /* DataTypeConversion: '<S958>/DataType' */
13989 L4_MABX_B.DataType_d = L4_MABX_B.Operator_aup;
13990
13991 /* DataTypeConversion: '<S941>/Data Type Conversion2' */
13992 L4_MABX_B.DataTypeConversion2_bk = (L4_MABX_B.DataType_co != 0);
13993
13994 /* ArithShift: '<S941>/Shift_Arithmetic ' */
13995 L4_MABX_B.Shift_Arithmetic_p = ldexp(L4_MABX_B.DataType_bi, (-1));
13996
13997 /* DataTypeConversion: '<S941>/Data Type Conversion3' */
13998 L4_MABX_B.DataTypeConversion3_cr = (L4_MABX_B.Shift_Arithmetic_p != 0.0);
13999
14000 /* ArithShift: '<S941>/Shift_Arithmetic 1' */
14001 L4_MABX_B.Shift_Arithmetic1_l = ldexp(L4_MABX_B.DataType_o, (-2));
14002
14003 /* DataTypeConversion: '<S941>/Data Type Conversion4' */
14004 L4_MABX_B.DataTypeConversion4_gin = (L4_MABX_B.Shift_Arithmetic1_l != 0.0);
14005
14006 /* ArithShift: '<S941>/Shift_Arithmetic 4' */
14007 L4_MABX_B.Shift_Arithmetic4_h = ldexp(L4_MABX_B.DataType_d, (-5));
14008
14009 /* DataTypeConversion: '<S941>/Data Type Conversion7' */
14010 L4_MABX_B.DataTypeConversion7_i = (L4_MABX_B.Shift_Arithmetic4_h != 0.0);
14011
14012 /* DataTypeConversion: '<S944>/Data Type Conversion' */
14013 L4_MABX_B.DataTypeConversion_hc = AutonomousOutputEnabled;
14014
14015 /* Switch: '<S978>/Switch' incorporates:
14016 * Constant: '<S978>/Constant'
14017 * Constant: '<S978>/Constant1'
14018 */
14019 if (L4_MABX_B.DataTypeConversion_hc != 0) {
14020 L4_MABX_B.Switch_l = L4_MABX_P.Constant_Value_cuw;
14021 } else {
14022 L4_MABX_B.Switch_l = L4_MABX_P.Constant1_Value_cd;
14023 }
14024
14025 /* End of Switch: '<S978>/Switch' */
14026
14027 /* DataTypeConversion: '<S976>/Data Type Conversion' */
14028 L4_MABX_B.DataTypeConversion_ep = L4_MABX_B.Switch_l;
14029
14030 /* RelationalOperator: '<S995>/Operator' incorporates:
14031 * Constant: '<S977>/Constant'
14032 * Constant: '<S977>/Constant6'
14033 */
14034 L4_MABX_B.Operator_o5 = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV ==
14035 L4_MABX_P.Constant_Value_ef);
14036
14037 /* Outputs for Enabled SubSystem: '<S977>/DEFAULT_TRQ_CTRL_MODE' */
14038 L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_o5, &L4_MABX_B.Merge,
14039 &L4_MABX_P.DEFAULT_TRQ_CTRL_MODE);
14040
14041 /* End of Outputs for SubSystem: '<S977>/DEFAULT_TRQ_CTRL_MODE' */
14042
14043 /* Switch: '<S994>/Switch' incorporates:
14044 * Constant: '<S994>/zero'
14045 */
14046 if (L4_MABX_B.DataTypeConversion_hc != 0) {
14047 /* MultiPortSwitch: '<S994>/Multiport_Switch' incorporates:
14048 * Constant: '<S994>/Constant1'
14049 * Constant: '<S994>/Constant7'
14050 */
14051 switch (PROPB_REAX_1_E4_DES_POS_SIG_SRC_APV) {
14052 case ENUM_STEERING_POS_SIGNAL_SOURCE_T_SW_EMULATION:
14053 L4_MABX_B.Multiport_Switch = PROPB_REAX_1_E4_DESIRED_POSITION_APV;
14054 break;
14055
14056 case ENUM_STEERING_POS_SIGNAL_SOURCE_T_ESTIMATION:
14057 L4_MABX_B.Multiport_Switch = L4_MABX_B.Subtract_c1;
14058 break;
14059
14060 default:
14061 L4_MABX_B.Multiport_Switch = PROPB_REAX_1_E4_DESIRED_POSITION_APV;
14062 break;
14063 }
14064
14065 /* End of MultiPortSwitch: '<S994>/Multiport_Switch' */
14066 L4_MABX_B.Switch_k = L4_MABX_B.Multiport_Switch;
14067 } else {
14068 L4_MABX_B.Switch_k = L4_MABX_P.zero_Value_h;
14069 }
14070
14071 /* End of Switch: '<S994>/Switch' */
14072
14073 /* RelationalOperator: '<S1004>/Operator_MX' incorporates:
14074 * Constant: '<S1004>/MX'
14075 */
14076 L4_MABX_B.Operator_MX = (L4_MABX_B.Switch_k > L4_MABX_P.MX_Value);
14077
14078 /* RelationalOperator: '<S1004>/Operator_MN' incorporates:
14079 * Constant: '<S1004>/MN'
14080 */
14081 L4_MABX_B.Operator_MN = (L4_MABX_B.Switch_k < L4_MABX_P.MN_Value);
14082
14083 /* Switch: '<S1004>/Switch2' incorporates:
14084 * Constant: '<S1004>/MX'
14085 * Switch: '<S1004>/Switch1'
14086 */
14087 if (L4_MABX_B.Operator_MX) {
14088 L4_MABX_B.Switch2 = L4_MABX_P.MX_Value;
14089 } else {
14090 if (L4_MABX_B.Operator_MN) {
14091 /* Switch: '<S1004>/Switch1' incorporates:
14092 * Constant: '<S1004>/MN'
14093 */
14094 L4_MABX_B.Switch1 = L4_MABX_P.MN_Value;
14095 } else {
14096 /* Switch: '<S1004>/Switch1' */
14097 L4_MABX_B.Switch1 = L4_MABX_B.Switch_k;
14098 }
14099
14100 L4_MABX_B.Switch2 = L4_MABX_B.Switch1;
14101 }
14102
14103 /* End of Switch: '<S1004>/Switch2' */
14104
14105 /* DataTypeConversion: '<S1004>/DataType' */
14106 L4_MABX_B.DataType_hl = L4_MABX_B.Switch2;
14107
14108 /* RelationalOperator: '<S996>/Operator' incorporates:
14109 * Constant: '<S977>/Constant1'
14110 * Constant: '<S977>/Constant6'
14111 */
14112 L4_MABX_B.Operator_epr = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV ==
14113 L4_MABX_P.Constant1_Value_a5);
14114
14115 /* Outputs for Enabled SubSystem: '<S977>/POSITION_CONTROL_MODE' incorporates:
14116 * EnablePort: '<S1005>/Enable'
14117 */
14118 if (L4_MABX_B.Operator_epr) {
14119 /* Product: '<S1005>/Product' incorporates:
14120 * Constant: '<S1005>/Constant'
14121 */
14122 L4_MABX_B.Product = L4_MABX_B.DataType_hl * L4_MABX_P.Constant_Value_iy;
14123
14124 /* DataTypeConversion: '<S1005>/Data Type Conversion' */
14125 PositionFinalLimited = floor(L4_MABX_B.Product);
14126 if (PositionFinalLimited < 2.147483648E+9) {
14127 if (PositionFinalLimited >= -2.147483648E+9) {
14128 i = (int32_T)PositionFinalLimited;
14129 } else {
14130 i = MIN_int32_T;
14131 }
14132 } else {
14133 i = MAX_int32_T;
14134 }
14135
14136 L4_MABX_B.Merge = i;
14137
14138 /* End of DataTypeConversion: '<S1005>/Data Type Conversion' */
14139 }
14140
14141 /* End of Outputs for SubSystem: '<S977>/POSITION_CONTROL_MODE' */
14142
14143 /* RelationalOperator: '<S997>/Operator' incorporates:
14144 * Constant: '<S977>/Constant2'
14145 * Constant: '<S977>/Constant6'
14146 */
14147 L4_MABX_B.Operator_gt = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV ==
14148 L4_MABX_P.Constant2_Value_bg);
14149
14150 /* Outputs for Enabled SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_A' */
14151 L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_gt, &L4_MABX_B.Merge,
14152 &L4_MABX_P.EXT_TRQ_CTRL_MODE_A);
14153
14154 /* End of Outputs for SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_A' */
14155
14156 /* RelationalOperator: '<S998>/Operator' incorporates:
14157 * Constant: '<S977>/Constant3'
14158 * Constant: '<S977>/Constant6'
14159 */
14160 L4_MABX_B.Operator_oy = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV ==
14161 L4_MABX_P.Constant3_Value_fz);
14162
14163 /* Outputs for Enabled SubSystem: '<S977>/ALL_CTRL_DISABLED' */
14164 L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_oy, &L4_MABX_B.Merge,
14165 &L4_MABX_P.ALL_CTRL_DISABLED);
14166
14167 /* End of Outputs for SubSystem: '<S977>/ALL_CTRL_DISABLED' */
14168
14169 /* RelationalOperator: '<S999>/Operator' incorporates:
14170 * Constant: '<S977>/Constant4'
14171 * Constant: '<S977>/Constant6'
14172 */
14173 L4_MABX_B.Operator_ek = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV ==
14174 L4_MABX_P.Constant4_Value_g);
14175
14176 /* Outputs for Enabled SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_B' */
14177 L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_ek, &L4_MABX_B.Merge,
14178 &L4_MABX_P.EXT_TRQ_CTRL_MODE_B);
14179
14180 /* End of Outputs for SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_B' */
14181
14182 /* RelationalOperator: '<S1000>/Operator' incorporates:
14183 * Constant: '<S977>/Constant5'
14184 * Constant: '<S977>/Constant6'
14185 */
14186 L4_MABX_B.Operator_acs = (PROPB_REAX_1_E4_DESIRED_OPMODE_APV ==
14187 L4_MABX_P.Constant5_Value_os);
14188
14189 /* Outputs for Enabled SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_C' */
14190 L4_MABX_ALL_CTRL_DISABLED(L4_MABX_B.Operator_acs, &L4_MABX_B.Merge,
14191 &L4_MABX_P.EXT_TRQ_CTRL_MODE_C);
14192
14193 /* End of Outputs for SubSystem: '<S977>/EXT_TRQ_CTRL_MODE_C' */
14194
14195 /* DataTypeConversion: '<S976>/Data Type Conversion2' */
14196 L4_MABX_B.DataTypeConversion2_j = (uint32_T)L4_MABX_B.Merge;
14197
14198 /* S-Function (sfix_bitop): '<S981>/Operator' */
14199 L4_MABX_B.Operator_g = L4_MABX_B.DataTypeConversion2_j &
14200 L4_MABX_P.Operator_BitMask_ij;
14201
14202 /* DataTypeConversion: '<S981>/DataType' */
14203 tmp = L4_MABX_B.Operator_g;
14204 if (tmp > 255U) {
14205 tmp = 255U;
14206 }
14207
14208 L4_MABX_B.DataType_jq = (uint8_T)tmp;
14209
14210 /* End of DataTypeConversion: '<S981>/DataType' */
14211
14212 /* S-Function (sfix_bitop): '<S982>/Operator' */
14213 L4_MABX_B.Operator_j = L4_MABX_B.DataTypeConversion2_j &
14214 L4_MABX_P.Operator_BitMask_kl;
14215
14216 /* DataTypeConversion: '<S982>/DataType' */
14217 tmp = L4_MABX_B.Operator_j;
14218 if (tmp > 65535U) {
14219 tmp = 65535U;
14220 }
14221
14222 L4_MABX_B.DataType_jj = (uint16_T)tmp;
14223
14224 /* End of DataTypeConversion: '<S982>/DataType' */
14225
14226 /* ArithShift: '<S976>/Shift_Arithmetic ' */
14227 L4_MABX_B.Shift_Arithmetic_j = (uint16_T)((uint32_T)L4_MABX_B.DataType_jj >> 8);
14228
14229 /* DataTypeConversion: '<S976>/Data Type Conversion4' */
14230 tmp_0 = L4_MABX_B.Shift_Arithmetic_j;
14231 if (tmp_0 > 255) {
14232 tmp_0 = 255U;
14233 }
14234
14235 L4_MABX_B.DataTypeConversion4_m2 = (uint8_T)tmp_0;
14236
14237 /* End of DataTypeConversion: '<S976>/Data Type Conversion4' */
14238
14239 /* S-Function (sfix_bitop): '<S983>/Operator' */
14240 L4_MABX_B.Operator_a = L4_MABX_B.DataTypeConversion2_j &
14241 L4_MABX_P.Operator_BitMask_ae;
14242
14243 /* DataTypeConversion: '<S983>/DataType' */
14244 L4_MABX_B.DataType_p = L4_MABX_B.Operator_a;
14245
14246 /* ArithShift: '<S976>/Shift_Arithmetic 1' */
14247 L4_MABX_B.Shift_Arithmetic1_pm = L4_MABX_B.DataType_p >> 16;
14248
14249 /* DataTypeConversion: '<S976>/Data Type Conversion5' */
14250 tmp = L4_MABX_B.Shift_Arithmetic1_pm;
14251 if (tmp > 255U) {
14252 tmp = 255U;
14253 }
14254
14255 L4_MABX_B.DataTypeConversion5_jw = (uint8_T)tmp;
14256
14257 /* End of DataTypeConversion: '<S976>/Data Type Conversion5' */
14258
14259 /* S-Function (sfix_bitop): '<S984>/Operator' */
14260 L4_MABX_B.Operator_na = L4_MABX_B.DataTypeConversion2_j &
14261 L4_MABX_P.Operator_BitMask_mz;
14262
14263 /* DataTypeConversion: '<S984>/DataType' */
14264 L4_MABX_B.DataType_gp = L4_MABX_B.Operator_na;
14265
14266 /* ArithShift: '<S976>/Shift_Arithmetic 2' */
14267 L4_MABX_B.Shift_Arithmetic2_n = L4_MABX_B.DataType_gp >> 24;
14268
14269 /* DataTypeConversion: '<S976>/Data Type Conversion6' */
14270 tmp = L4_MABX_B.Shift_Arithmetic2_n;
14271 if (tmp > 255U) {
14272 tmp = 255U;
14273 }
14274
14275 L4_MABX_B.DataTypeConversion6_pb = (uint8_T)tmp;
14276
14277 /* End of DataTypeConversion: '<S976>/Data Type Conversion6' */
14278
14279 /* Reshape: '<S1006>/Reshape' incorporates:
14280 * Constant: '<S1006>/Constant'
14281 */
14282 for (i = 0; i < 16; i++) {
14283 L4_MABX_B.Reshape_e[i] = L4_MABX_P.Repeating_Sequence_Stair_OutV_h[i];
14284 }
14285
14286 /* End of Reshape: '<S1006>/Reshape' */
14287
14288 /* UnitDelay: '<S1006>/Unit_Delay' */
14289 L4_MABX_B.Unit_Delay_jm = L4_MABX_DW.Unit_Delay_DSTATE_im;
14290
14291 /* UnitDelay: '<S1007>/Unit Delay' */
14292 L4_MABX_B.UnitDelay_j = L4_MABX_DW.UnitDelay_DSTATE_mk;
14293
14294 /* Switch: '<S1010>/Switch1' incorporates:
14295 * Constant: '<S1007>/E'
14296 * Constant: '<S1007>/IV'
14297 * Switch: '<S1009>/Switch1'
14298 */
14299 if (L4_MABX_B.Unit_Delay_jm) {
14300 L4_MABX_B.Switch1_ab = L4_MABX_P.IV_Value_ec;
14301 } else {
14302 if (L4_MABX_P.E_Value_o) {
14303 /* Sum: '<S1007>/Subtract' incorporates:
14304 * Constant: '<S1007>/Constant'
14305 * Switch: '<S1009>/Switch1'
14306 */
14307 q0 = L4_MABX_P.Constant_Value_k3;
14308 tmp = q0 + L4_MABX_B.UnitDelay_j;
14309 if (tmp < q0) {
14310 tmp = MAX_uint32_T;
14311 }
14312
14313 L4_MABX_B.Subtract_bg = tmp;
14314
14315 /* End of Sum: '<S1007>/Subtract' */
14316
14317 /* Switch: '<S1009>/Switch1' */
14318 L4_MABX_B.Switch1_h = L4_MABX_B.Subtract_bg;
14319 } else {
14320 /* Switch: '<S1009>/Switch1' */
14321 L4_MABX_B.Switch1_h = L4_MABX_B.UnitDelay_j;
14322 }
14323
14324 L4_MABX_B.Switch1_ab = L4_MABX_B.Switch1_h;
14325 }
14326
14327 /* End of Switch: '<S1010>/Switch1' */
14328
14329 /* Selector: '<S1006>/Selector' */
14330 L4_MABX_B.Selector_k = L4_MABX_B.Reshape_e[(int32_T)L4_MABX_B.Switch1_ab - 1];
14331
14332 /* DataTypeConversion: '<S976>/Data Type Conversion1' */
14333 L4_MABX_B.DataTypeConversion1_nz = L4_MABX_B.Selector_k;
14334
14335 /* S-Function (sfix_bitop): '<S989>/Operator' */
14336 L4_MABX_B.Operator_hw = (uint8_T)(L4_MABX_B.DataTypeConversion1_nz &
14337 L4_MABX_P.Operator_BitMask_ki);
14338
14339 /* DataTypeConversion: '<S989>/DataType' */
14340 L4_MABX_B.DataType_bs = L4_MABX_B.Operator_hw;
14341
14342 /* DataTypeConversion: '<S975>/Data Type Conversion' incorporates:
14343 * Constant: '<S975>/Priority'
14344 */
14345 L4_MABX_B.DataTypeConversion_iv = L4_MABX_P.Priority_Value_d;
14346
14347 /* ArithShift: '<S975>/Shift_Arithmetic ' */
14348 L4_MABX_B.Shift_Arithmetic_h = L4_MABX_B.DataTypeConversion_iv << 26;
14349
14350 /* DataTypeConversion: '<S975>/Data Type Conversion1' incorporates:
14351 * Constant: '<S975>/ExtendedDataPage'
14352 */
14353 L4_MABX_B.DataTypeConversion1_d = L4_MABX_P.ExtendedDataPage_Value_h;
14354
14355 /* ArithShift: '<S975>/Shift_Arithmetic 1' */
14356 L4_MABX_B.Shift_Arithmetic1_d = L4_MABX_B.DataTypeConversion1_d << 25;
14357
14358 /* DataTypeConversion: '<S975>/Data Type Conversion2' incorporates:
14359 * Constant: '<S975>/DataPage'
14360 */
14361 L4_MABX_B.DataTypeConversion2_i0 = L4_MABX_P.DataPage_Value_b;
14362
14363 /* ArithShift: '<S975>/Shift_Arithmetic 2' */
14364 L4_MABX_B.Shift_Arithmetic2_f = L4_MABX_B.DataTypeConversion2_i0 << 24;
14365
14366 /* DataTypeConversion: '<S975>/Data Type Conversion3' incorporates:
14367 * Constant: '<S975>/PDUFormat'
14368 */
14369 L4_MABX_B.DataTypeConversion3_ju = L4_MABX_P.PDUFormat_Value_m;
14370
14371 /* ArithShift: '<S975>/Shift_Arithmetic 3' */
14372 L4_MABX_B.Shift_Arithmetic3_pk = L4_MABX_B.DataTypeConversion3_ju << 16;
14373
14374 /* DataTypeConversion: '<S975>/Data Type Conversion4' incorporates:
14375 * Constant: '<S975>/PDUSpecific'
14376 */
14377 L4_MABX_B.DataTypeConversion4_f3 = L4_MABX_P.PDUSpecific_Value_h;
14378
14379 /* ArithShift: '<S975>/Shift_Arithmetic 4' */
14380 L4_MABX_B.Shift_Arithmetic4_hr = L4_MABX_B.DataTypeConversion4_f3 << 8;
14381
14382 /* DataTypeConversion: '<S975>/Data Type Conversion5' incorporates:
14383 * Constant: '<S975>/SourceAddress'
14384 */
14385 L4_MABX_B.DataTypeConversion5_c = L4_MABX_P.SourceAddress_Value_h;
14386
14387 /* S-Function (sfix_bitop): '<S980>/Operator' */
14388 L4_MABX_B.Operator_d = L4_MABX_B.Shift_Arithmetic_h |
14389 L4_MABX_B.Shift_Arithmetic1_d | L4_MABX_B.Shift_Arithmetic2_f |
14390 L4_MABX_B.Shift_Arithmetic3_pk | L4_MABX_B.Shift_Arithmetic4_hr |
14391 L4_MABX_B.DataTypeConversion5_c;
14392
14393 /* DataTypeConversion: '<S980>/DataType' */
14394 L4_MABX_B.DataType_nqw = L4_MABX_B.Operator_d;
14395
14396 /* DataTypeConversion: '<S976>/Data Type Conversion3' */
14397 L4_MABX_B.DataTypeConversion3_hef = L4_MABX_B.DataType_nqw;
14398
14399 /* S-Function (sfix_bitop): '<S985>/Operator' */
14400 L4_MABX_B.Operator_af = L4_MABX_B.DataTypeConversion3_hef &
14401 L4_MABX_P.Operator_BitMask_i1;
14402
14403 /* DataTypeConversion: '<S985>/DataType' */
14404 tmp = L4_MABX_B.Operator_af;
14405 if (tmp > 255U) {
14406 tmp = 255U;
14407 }
14408
14409 L4_MABX_B.DataType_hn = (uint8_T)tmp;
14410
14411 /* End of DataTypeConversion: '<S985>/DataType' */
14412
14413 /* S-Function (sfix_bitop): '<S986>/Operator' */
14414 L4_MABX_B.Operator_m = L4_MABX_B.DataTypeConversion3_hef &
14415 L4_MABX_P.Operator_BitMask_jz;
14416
14417 /* DataTypeConversion: '<S986>/DataType' */
14418 tmp = L4_MABX_B.Operator_m;
14419 if (tmp > 65535U) {
14420 tmp = 65535U;
14421 }
14422
14423 L4_MABX_B.DataType_fg = (uint16_T)tmp;
14424
14425 /* End of DataTypeConversion: '<S986>/DataType' */
14426
14427 /* ArithShift: '<S976>/Shift_Arithmetic 3' */
14428 L4_MABX_B.Shift_Arithmetic3_k = (uint16_T)((uint32_T)L4_MABX_B.DataType_fg >>
14429 8);
14430
14431 /* DataTypeConversion: '<S976>/Data Type Conversion8' */
14432 tmp_0 = L4_MABX_B.Shift_Arithmetic3_k;
14433 if (tmp_0 > 255) {
14434 tmp_0 = 255U;
14435 }
14436
14437 L4_MABX_B.DataTypeConversion8_p = (uint8_T)tmp_0;
14438
14439 /* End of DataTypeConversion: '<S976>/Data Type Conversion8' */
14440
14441 /* S-Function (sfix_bitop): '<S987>/Operator' */
14442 L4_MABX_B.Operator_h = L4_MABX_B.DataTypeConversion3_hef &
14443 L4_MABX_P.Operator_BitMask_g1;
14444
14445 /* DataTypeConversion: '<S987>/DataType' */
14446 L4_MABX_B.DataType_cw = L4_MABX_B.Operator_h;
14447
14448 /* ArithShift: '<S976>/Shift_Arithmetic 4' */
14449 L4_MABX_B.Shift_Arithmetic4_j = L4_MABX_B.DataType_cw >> 16;
14450
14451 /* DataTypeConversion: '<S976>/Data Type Conversion9' */
14452 tmp = L4_MABX_B.Shift_Arithmetic4_j;
14453 if (tmp > 255U) {
14454 tmp = 255U;
14455 }
14456
14457 L4_MABX_B.DataTypeConversion9_g = (uint8_T)tmp;
14458
14459 /* End of DataTypeConversion: '<S976>/Data Type Conversion9' */
14460
14461 /* S-Function (sfix_bitop): '<S988>/Operator' */
14462 L4_MABX_B.Operator_ne = L4_MABX_B.DataTypeConversion3_hef &
14463 L4_MABX_P.Operator_BitMask_ik;
14464
14465 /* DataTypeConversion: '<S988>/DataType' */
14466 L4_MABX_B.DataType_gx = L4_MABX_B.Operator_ne;
14467
14468 /* ArithShift: '<S976>/Shift_Arithmetic 5' */
14469 L4_MABX_B.Shift_Arithmetic5_g = L4_MABX_B.DataType_gx >> 24;
14470
14471 /* DataTypeConversion: '<S976>/Data Type Conversion10' */
14472 tmp = L4_MABX_B.Shift_Arithmetic5_g;
14473 if (tmp > 255U) {
14474 tmp = 255U;
14475 }
14476
14477 L4_MABX_B.DataTypeConversion10_a = (uint8_T)tmp;
14478
14479 /* End of DataTypeConversion: '<S976>/Data Type Conversion10' */
14480
14481 /* Sum: '<S976>/Add' incorporates:
14482 * Constant: '<S976>/Constant'
14483 * Constant: '<S976>/Constant1'
14484 */
14485 L4_MABX_B.Add_ow = (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)
14486 (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)
14487 ((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)
14488 (uint8_T)((uint32_T)L4_MABX_B.DataTypeConversion_ep + L4_MABX_B.DataType_jq)
14489 + L4_MABX_B.DataTypeConversion4_m2) + L4_MABX_B.DataTypeConversion5_jw) +
14490 L4_MABX_B.DataTypeConversion6_pb) + L4_MABX_P.Constant_Value_blu) +
14491 L4_MABX_P.Constant1_Value_pc) + L4_MABX_B.DataType_hn) +
14492 L4_MABX_B.DataTypeConversion8_p) + L4_MABX_B.DataTypeConversion9_g)
14493 + L4_MABX_B.DataTypeConversion10_a) + L4_MABX_B.DataType_bs);
14494
14495 /* ArithShift: '<S976>/Shift_Arithmetic 6' */
14496 L4_MABX_B.Shift_Arithmetic6_m = (uint8_T)((uint32_T)L4_MABX_B.Add_ow >> 4);
14497
14498 /* Sum: '<S976>/Add1' */
14499 L4_MABX_B.Add1_pa = (uint8_T)((uint32_T)L4_MABX_B.Shift_Arithmetic6_m +
14500 L4_MABX_B.Add_ow);
14501
14502 /* S-Function (sfix_bitop): '<S990>/Operator' */
14503 L4_MABX_B.Operator_k3 = (uint8_T)(L4_MABX_B.Add1_pa &
14504 L4_MABX_P.Operator_BitMask_fi);
14505
14506 /* DataTypeConversion: '<S990>/DataType' */
14507 L4_MABX_B.DataType_j4 = L4_MABX_B.Operator_k3;
14508
14509 /* ArithShift: '<S976>/Shift_Arithmetic 7' */
14510 L4_MABX_B.Shift_Arithmetic7_j = (uint8_T)(L4_MABX_B.DataType_j4 << 4);
14511
14512 /* S-Function (sfix_bitop): '<S991>/Operator' */
14513 L4_MABX_B.Operator_gp = (uint8_T)(L4_MABX_B.DataType_bs |
14514 L4_MABX_B.Shift_Arithmetic7_j);
14515
14516 /* DataTypeConversion: '<S991>/DataType' */
14517 L4_MABX_B.DataType_n0 = L4_MABX_B.Operator_gp;
14518
14519 /* DataTypeConversion: '<S942>/Data Type Conversion1' incorporates:
14520 * Constant: '<S976>/Constant'
14521 * Constant: '<S976>/Constant1'
14522 */
14523 L4_MABX_B.DataTypeConversion1_ox[0] = L4_MABX_B.DataTypeConversion_ep;
14524 L4_MABX_B.DataTypeConversion1_ox[1] = L4_MABX_B.DataType_jq;
14525 L4_MABX_B.DataTypeConversion1_ox[2] = L4_MABX_B.DataTypeConversion4_m2;
14526 L4_MABX_B.DataTypeConversion1_ox[3] = L4_MABX_B.DataTypeConversion5_jw;
14527 L4_MABX_B.DataTypeConversion1_ox[4] = L4_MABX_B.DataTypeConversion6_pb;
14528 L4_MABX_B.DataTypeConversion1_ox[5] = L4_MABX_P.Constant_Value_blu;
14529 L4_MABX_B.DataTypeConversion1_ox[6] = L4_MABX_P.Constant1_Value_pc;
14530 L4_MABX_B.DataTypeConversion1_ox[7] = L4_MABX_B.DataType_n0;
14531
14532 /* Outputs for Enabled SubSystem: '<S963>/PropB_REAX_1_E4' incorporates:
14533 * EnablePort: '<S965>/Enable'
14534 */
14535 if (L4_MABX_B.Operator_jhs) {
14536 /* S-Function (rti_commonblock): '<S965>/S-Function1' incorporates:
14537 * Constant: '<S963>/Constant'
14538 * Constant: '<S963>/Constant1'
14539 */
14540 /* This comment workarounds a code generation problem */
14541
14542 /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */
14543 {
14544 static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
14545 0x00 };
14546
14547 Float32 delayTime = 0.0;
14548
14549 /* link this pointer to CAN_Msg for use in initialize_io_units() */
14550 CANTP1_PTR_M1_C2_XTD_0x18FFEFE4 = &(CAN_Msg[0]);
14551
14552 /* ... perform loop-back if required */
14553 if (L4_MABX_P.Constant1_Value_o1 > 0.5) {
14554 /* ... updating the used tx-clientbuffer */
14555 can_tp1_msg_update_all( CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->module,
14556 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->queue );
14557
14558 /* ... Read status and timestamp info perform loop-back (previous message) */
14559 can_tp1_tx_msg_read_loopback(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4,
14560 8, // datalen
14561 &(CAN_Msg[0]),
14562 CANTP1_RX_SPMSG_M1_C2_XTD);
14563
14564 /* Convert timestamp */
14565 if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->processed) {
14566 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp =
14567 rtk_dsts_time_to_simtime_convert
14568 (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp);
14569 }
14570 } else {
14571 /* ... Read status and timestamp info (previous message) */
14572 can_tp1_msg_read_from_dsmcr(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4);
14573
14574 /* Convert timestamp */
14575 if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->processed) {
14576 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp =
14577 rtk_dsts_time_to_simtime_convert
14578 (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp);
14579 }
14580 }
14581
14582 /* Messages with timestamp zero have been received in pause/stop state
14583 and must not be handled.
14584 */
14585 if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp > 0.0) {
14586 L4_MABX_B.SFunction1_o1_a5 = (real_T)
14587 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->processed;
14588 L4_MABX_B.SFunction1_o2_nw = (real_T)
14589 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->timestamp;
14590 L4_MABX_B.SFunction1_o3_g1 = (real_T)
14591 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->deltatime;
14592 L4_MABX_B.SFunction1_o4_c = (real_T)
14593 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFEFE4->delaytime;
14594 }
14595
14596 /* ... Encode Simulink signals of TX and RM blocks*/
14597 {
14598 rtican_Signal_t CAN_Sgn;
14599 UInt32 i;
14600
14601 /* Initialize the static message data to zero */
14602 for (i=0; i<8; i++ )
14603 CAN_Msg[i] = 0;
14604
14605 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
14606 /* Add or substract 0.5 in order to round to nearest integer */
14607 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[0] )
14608 + 0.5);
14609 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14610 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
14611
14612 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
14613 /* Add or substract 0.5 in order to round to nearest integer */
14614 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[1] )
14615 + 0.5);
14616 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14617 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
14618
14619 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
14620 /* Add or substract 0.5 in order to round to nearest integer */
14621 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[2] )
14622 + 0.5);
14623 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14624 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
14625
14626 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
14627 /* Add or substract 0.5 in order to round to nearest integer */
14628 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[3] )
14629 + 0.5);
14630 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14631 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
14632
14633 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
14634 /* Add or substract 0.5 in order to round to nearest integer */
14635 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[4] )
14636 + 0.5);
14637 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14638 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
14639
14640 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
14641 /* Add or substract 0.5 in order to round to nearest integer */
14642 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[5] )
14643 + 0.5);
14644 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14645 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
14646
14647 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
14648 /* Add or substract 0.5 in order to round to nearest integer */
14649 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[6] )
14650 + 0.5);
14651 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14652 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
14653
14654 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
14655 /* Add or substract 0.5 in order to round to nearest integer */
14656 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[7] )
14657 + 0.5);
14658 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14659 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
14660 }
14661
14662 delayTime = (Float32) L4_MABX_P.Constant_Value_l3 / (1700);
14663
14664 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
14665 can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFEFE4], 8,
14666 &(CAN_Msg[0]), delayTime);
14667 }
14668 }
14669
14670 /* End of Outputs for SubSystem: '<S963>/PropB_REAX_1_E4' */
14671
14672 /* Outputs for Enabled SubSystem: '<S964>/PropB_REAX_1_E4' incorporates:
14673 * EnablePort: '<S966>/Enable'
14674 */
14675 if (L4_MABX_B.EnablePropB_ReAX_CAN6) {
14676 /* S-Function (rti_commonblock): '<S966>/S-Function1' incorporates:
14677 * Constant: '<S964>/Constant'
14678 * Constant: '<S964>/Constant1'
14679 */
14680 /* This comment workarounds a code generation problem */
14681
14682 /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */
14683 {
14684 static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
14685 0x00 };
14686
14687 Float32 delayTime = 0.0;
14688
14689 /* link this pointer to CAN_Msg for use in initialize_io_units() */
14690 CANTP1_PTR_M3_C2_XTD_0x18FFEFE4 = &(CAN_Msg[0]);
14691
14692 /* ... perform loop-back if required */
14693 if (L4_MABX_P.Constant1_Value_at > 0.5) {
14694 /* ... updating the used tx-clientbuffer */
14695 can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->module,
14696 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->queue );
14697
14698 /* ... Read status and timestamp info perform loop-back (previous message) */
14699 can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4,
14700 8, // datalen
14701 &(CAN_Msg[0]),
14702 CANTP1_RX_SPMSG_M3_C2_XTD);
14703
14704 /* Convert timestamp */
14705 if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->processed) {
14706 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp =
14707 rtk_dsts_time_to_simtime_convert
14708 (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp);
14709 }
14710 } else {
14711 /* ... Read status and timestamp info (previous message) */
14712 can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4);
14713
14714 /* Convert timestamp */
14715 if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->processed) {
14716 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp =
14717 rtk_dsts_time_to_simtime_convert
14718 (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp);
14719 }
14720 }
14721
14722 /* Messages with timestamp zero have been received in pause/stop state
14723 and must not be handled.
14724 */
14725 if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp > 0.0) {
14726 L4_MABX_B.SFunction1_o1_c = (real_T)
14727 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->processed;
14728 L4_MABX_B.SFunction1_o2_a = (real_T)
14729 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->timestamp;
14730 L4_MABX_B.SFunction1_o3_n1 = (real_T)
14731 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->deltatime;
14732 L4_MABX_B.SFunction1_o4_my = (real_T)
14733 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFEFE4->delaytime;
14734 }
14735
14736 /* ... Encode Simulink signals of TX and RM blocks*/
14737 {
14738 rtican_Signal_t CAN_Sgn;
14739 UInt32 i;
14740
14741 /* Initialize the static message data to zero */
14742 for (i=0; i<8; i++ )
14743 CAN_Msg[i] = 0;
14744
14745 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
14746 /* Add or substract 0.5 in order to round to nearest integer */
14747 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[0] )
14748 + 0.5);
14749 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14750 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
14751
14752 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
14753 /* Add or substract 0.5 in order to round to nearest integer */
14754 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[1] )
14755 + 0.5);
14756 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14757 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
14758
14759 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
14760 /* Add or substract 0.5 in order to round to nearest integer */
14761 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[2] )
14762 + 0.5);
14763 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14764 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
14765
14766 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
14767 /* Add or substract 0.5 in order to round to nearest integer */
14768 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[3] )
14769 + 0.5);
14770 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14771 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
14772
14773 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
14774 /* Add or substract 0.5 in order to round to nearest integer */
14775 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[4] )
14776 + 0.5);
14777 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14778 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
14779
14780 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
14781 /* Add or substract 0.5 in order to round to nearest integer */
14782 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[5] )
14783 + 0.5);
14784 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14785 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
14786
14787 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
14788 /* Add or substract 0.5 in order to round to nearest integer */
14789 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[6] )
14790 + 0.5);
14791 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14792 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
14793
14794 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
14795 /* Add or substract 0.5 in order to round to nearest integer */
14796 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ox[7] )
14797 + 0.5);
14798 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14799 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
14800 }
14801
14802 delayTime = (Float32) L4_MABX_P.Constant_Value_nk / (1700);
14803
14804 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
14805 can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFEFE4], 8,
14806 &(CAN_Msg[0]), delayTime);
14807 }
14808 }
14809
14810 /* End of Outputs for SubSystem: '<S964>/PropB_REAX_1_E4' */
14811
14812 /* DataTypeConversion: '<S943>/Data Type Conversion' incorporates:
14813 * Constant: '<S854>/CANT_VDC2_0B_CHANNEL_APV'
14814 */
14815 L4_MABX_B.DataTypeConversion_cw4 = (uint8_T)
14816 L4_MABX_P.CANT_VDC2_0B_CHANNEL_APV_Value;
14817
14818 /* S-Function (sfix_bitop): '<S971>/Operator' */
14819 L4_MABX_B.Operator_dk = (uint8_T)(L4_MABX_B.DataTypeConversion_cw4 &
14820 L4_MABX_P.Operator_BitMask_m);
14821
14822 /* DataTypeConversion: '<S971>/DataType' */
14823 L4_MABX_B.DataType_a = L4_MABX_B.Operator_dk;
14824
14825 /* ArithShift: '<S943>/Shift_Arithmetic 3' */
14826 L4_MABX_B.Shift_Arithmetic3_m = ldexp(L4_MABX_B.DataType_a, (-4));
14827
14828 /* DataTypeConversion: '<S943>/Data Type Conversion6' */
14829 L4_MABX_B.DataTypeConversion6_o = (L4_MABX_B.Shift_Arithmetic3_m != 0.0);
14830
14831 /* Outputs for Enabled SubSystem: '<S973>/VDC2_0B' incorporates:
14832 * EnablePort: '<S974>/Enable'
14833 */
14834 if (L4_MABX_B.DataTypeConversion6_o) {
14835 /* S-Function (rti_commonblock): '<S974>/S-Function1' */
14836 /* This comment workarounds a code generation problem */
14837
14838 /* dSPACE RTICAN TX Message Block: "VDC2_0B" Id:418384139 */
14839 {
14840 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
14841
14842 Float32 delayTime = 0.0;
14843
14844 /* ... Read status and timestamp info (previous message) */
14845 can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]);
14846
14847 /* Convert timestamp */
14848 if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->processed) {
14849 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp =
14850 rtk_dsts_time_to_simtime_convert
14851 (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp);
14852 }
14853
14854 /* Messages with timestamp zero have been received in pause/stop state
14855 and must not be handled.
14856 */
14857 if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp > 0.0) {
14858 L4_MABX_B.SFunction1_o1_h4 = (real_T)
14859 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->processed;
14860 L4_MABX_B.SFunction1_o2_b1 = (real_T)
14861 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->timestamp;
14862 L4_MABX_B.SFunction1_o3_n = (real_T)
14863 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->deltatime;
14864 L4_MABX_B.SFunction1_o4_jv = (real_T)
14865 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B]->delaytime;
14866 }
14867
14868 /* ... Encode Simulink signals of TX and RM blocks*/
14869 {
14870 rtican_Signal_t CAN_Sgn;
14871
14872 /* ...... "SteerWheelAngle" (0|16, standard signal, unsigned int, little endian) */
14873 /* Add or substract 0.5 in order to round to nearest integer */
14874 CAN_Sgn.UnsignedSgn = (UInt32) (( SteerWheelAngle - ( -31.374 ) ) /
14875 0.0009765625 + 0.5);
14876 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
14877 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
14878 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1;
14879
14880 /* ...... "SteerWheelTurnCounter" (16|6, standard signal, unsigned int, little endian) */
14881 /* Add or substract 0.5 in order to round to nearest integer */
14882 CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.SFunction1_o2_i - ( -32 ) +
14883 0.5);
14884 CAN_Sgn.UnsignedSgn &= 0x0000003F;
14885 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
14886
14887 /* ...... "SteerWheelAngleSensorType" (22|2, standard signal, unsigned int, little endian) */
14888 /* Add or substract 0.5 in order to round to nearest integer */
14889 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o3_a0 ) + 0.5);
14890 CAN_Sgn.UnsignedSgn &= 0x00000003;
14891 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
14892 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
14893
14894 /* ...... "YawRate" (24|16, standard signal, unsigned int, little endian) */
14895 /* Add or substract 0.5 in order to round to nearest integer */
14896 CAN_Sgn.UnsignedSgn = (UInt32) (( YawRate - ( -3.92 ) ) /
14897 0.0001220703125 + 0.5);
14898 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
14899 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
14900 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1;
14901
14902 /* ...... "LateralAcceleration" (40|16, standard signal, unsigned int, little endian) */
14903 /* Add or substract 0.5 in order to round to nearest integer */
14904 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o5_f - ( -15.687 )
14905 ) / 0.00048828125 + 0.5);
14906 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
14907 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
14908 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte1;
14909
14910 /* ...... "LongitudinalAcceleration" (56|8, standard signal, unsigned int, little endian) */
14911 /* Add or substract 0.5 in order to round to nearest integer */
14912 CAN_Sgn.UnsignedSgn = (UInt32) (( SPN1810_LongitudinalAcceleration -
14913 ( -12.5 ) ) / 0.1 + 0.5);
14914 CAN_Sgn.UnsignedSgn &= 0x000000FF;
14915 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
14916 }
14917
14918 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
14919 can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B], 8,
14920 &(CAN_Msg[0]), delayTime);
14921 }
14922 }
14923
14924 /* End of Outputs for SubSystem: '<S973>/VDC2_0B' */
14925
14926 /* S-Function (sfix_bitop): '<S967>/Operator' */
14927 L4_MABX_B.Operator_nq = (uint8_T)(L4_MABX_B.DataTypeConversion_cw4 &
14928 L4_MABX_P.Operator_BitMask_ms);
14929
14930 /* DataTypeConversion: '<S967>/DataType' */
14931 L4_MABX_B.DataType_jg = L4_MABX_B.Operator_nq;
14932
14933 /* S-Function (sfix_bitop): '<S968>/Operator' */
14934 L4_MABX_B.Operator_bu = (uint8_T)(L4_MABX_B.DataTypeConversion_cw4 &
14935 L4_MABX_P.Operator_BitMask_dj);
14936
14937 /* DataTypeConversion: '<S968>/DataType' */
14938 L4_MABX_B.DataType_lr = L4_MABX_B.Operator_bu;
14939
14940 /* S-Function (sfix_bitop): '<S969>/Operator' */
14941 L4_MABX_B.Operator_gf = (uint8_T)(L4_MABX_B.DataTypeConversion_cw4 &
14942 L4_MABX_P.Operator_BitMask_oby);
14943
14944 /* DataTypeConversion: '<S969>/DataType' */
14945 L4_MABX_B.DataType_ms = L4_MABX_B.Operator_gf;
14946
14947 /* S-Function (sfix_bitop): '<S970>/Operator' */
14948 L4_MABX_B.Operator_br = (uint8_T)(L4_MABX_B.DataTypeConversion_cw4 &
14949 L4_MABX_P.Operator_BitMask_cb);
14950
14951 /* DataTypeConversion: '<S970>/DataType' */
14952 L4_MABX_B.DataType_aw = L4_MABX_B.Operator_br;
14953
14954 /* S-Function (sfix_bitop): '<S972>/Operator' */
14955 L4_MABX_B.Operator_d2 = (uint8_T)(L4_MABX_B.DataTypeConversion_cw4 &
14956 L4_MABX_P.Operator_BitMask_nk);
14957
14958 /* DataTypeConversion: '<S972>/DataType' */
14959 L4_MABX_B.DataType_k = L4_MABX_B.Operator_d2;
14960
14961 /* DataTypeConversion: '<S943>/Data Type Conversion1' */
14962 L4_MABX_B.DataTypeConversion1_ip = (L4_MABX_B.DataType_jg != 0);
14963
14964 /* ArithShift: '<S943>/Shift_Arithmetic ' */
14965 L4_MABX_B.Shift_Arithmetic_c = ldexp(L4_MABX_B.DataType_lr, (-1));
14966
14967 /* DataTypeConversion: '<S943>/Data Type Conversion3' */
14968 L4_MABX_B.DataTypeConversion3_hb = (L4_MABX_B.Shift_Arithmetic_c != 0.0);
14969
14970 /* ArithShift: '<S943>/Shift_Arithmetic 1' */
14971 L4_MABX_B.Shift_Arithmetic1_b = ldexp(L4_MABX_B.DataType_ms, (-2));
14972
14973 /* DataTypeConversion: '<S943>/Data Type Conversion4' */
14974 L4_MABX_B.DataTypeConversion4_d = (L4_MABX_B.Shift_Arithmetic1_b != 0.0);
14975
14976 /* ArithShift: '<S943>/Shift_Arithmetic 2' */
14977 L4_MABX_B.Shift_Arithmetic2_hd = ldexp(L4_MABX_B.DataType_aw, (-3));
14978
14979 /* DataTypeConversion: '<S943>/Data Type Conversion5' */
14980 L4_MABX_B.DataTypeConversion5_ld = (L4_MABX_B.Shift_Arithmetic2_hd != 0.0);
14981
14982 /* ArithShift: '<S943>/Shift_Arithmetic 4' */
14983 L4_MABX_B.Shift_Arithmetic4_e = ldexp(L4_MABX_B.DataType_k, (-5));
14984
14985 /* DataTypeConversion: '<S943>/Data Type Conversion7' */
14986 L4_MABX_B.DataTypeConversion7_ns = (L4_MABX_B.Shift_Arithmetic4_e != 0.0);
14987
14988 /* Logic: '<S1004>/Logical Operator1' */
14989 L4_MABX_B.LogicalOperator1_l = !L4_MABX_B.Operator_MX;
14990
14991 /* Logic: '<S1004>/Logical Operator' */
14992 L4_MABX_B.LogicalOperator_nk = (L4_MABX_B.LogicalOperator1_l &&
14993 L4_MABX_B.Operator_MN);
14994
14995 /* RelationalOperator: '<S1008>/Operator' */
14996 L4_MABX_B.Operator_n3 = (L4_MABX_B.Switch1_ab == L4_MABX_B.Width_p);
14997
14998 /* End of Outputs for SubSystem: '<S849>/CAN_TX_10ms' */
14999
15000 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_20ms' */
15001
15002 /* RateTransition: '<S1015>/TmpRTBAtDivide1Inport1' */
15003 if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) {
15004 L4_MABX_B.BrakingPID_Y_k = L4_MABX_B.BrakingPID_Y_k5;
15005 L4_MABX_B.AutonomousOutputEnabled_i = AutonomousOutputEnabled;
15006 L4_MABX_B.BrakingControlActive_h = L4_MABX_B.F_Brake_control_active;
15007 L4_MABX_B.TmpRTBAtLogicalOperator8Inport1 = AutonomousOutputEnabled;
15008 L4_MABX_B.TmpRTBAtLogicalOperator1Inport2 = AutonomousOutputEnabled;
15009 L4_MABX_B.TmpRTBAtUnit_DelayInport1 = AutonomousOutputEnabled;
15010 L4_MABX_B.BrakingPID_Y_kq = L4_MABX_B.BrakingPID_Y_k5;
15011 L4_MABX_B.FrontAxleSpeed_e = L4_MABX_B.SFunction1_o1_ie;
15012 L4_MABX_B.SPN1807_SteeringWheelAngle_h = SteerWheelAngle;
15013 L4_MABX_B.SPN1808_YawRate_h = YawRate;
15014 L4_MABX_B.SPN1810_LongitudinalAccelerat_d = SPN1810_LongitudinalAcceleration;
15015 }
15016
15017 /* End of Outputs for SubSystem: '<S849>/CAN_TX_20ms' */
15018
15019 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */
15020
15021 /* RateTransition: '<S1044>/TmpRTBAtOperatorInport2' */
15022 if (L4_MABX_M->Timing.RateInteraction.TID0_7 == 1) {
15023 L4_MABX_B.TmpRTBAtOperatorInport2 = AutonomousOutputEnabled;
15024 }
15025
15026 /* End of RateTransition: '<S1044>/TmpRTBAtOperatorInport2' */
15027
15028 /* End of Outputs for SubSystem: '<S849>/CAN_TX_5000ms' */
15029
15030 /* Outputs for Enabled SubSystem: '<S640>/TC1_03_05' incorporates:
15031 * EnablePort: '<S641>/Enable'
15032 */
15033 /* Constant: '<S455>/Constant' */
15034 if (L4_MABX_P.Constant_Value_jf3) {
15035 /* S-Function (rti_commonblock): '<S641>/S-Function1' */
15036 /* This comment workarounds a code generation problem */
15037
15038 /* dSPACE RTICAN RX Message Block: "TC1_03_05" Id:201392901 */
15039 {
15040 UInt32 *CAN_Msg;
15041 static dsfloat time_old = 0.0;
15042
15043 /* Read status and timestamp info (previous message) */
15044 if (can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].timestamp !=
15045 time_old) {
15046 /* ... save timestamp info for the calculation of the RX status
15047 during the consecutive sample hit*/
15048 time_old = can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].
15049 timestamp;
15050
15051 /* ... set the processed flag to one */
15052 L4_MABX_B.SFunction1_o26 = 1.0;
15053 L4_MABX_B.SFunction1_o27 = (real_T)
15054 can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].timestamp;
15055 L4_MABX_B.SFunction1_o28 = (real_T)
15056 can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].deltatime;
15057 CAN_Msg = can_type1_M3_C1_XTD[CANTP1_M3_C1_RXSRVC_XTD_0xC010305].data;
15058
15059 /* Decode CAN message */
15060 {
15061 {
15062 rtican_Signal_t CAN_Sgn;
15063
15064 /* ...... "SPN681_TransGearShiftInhibitReq" (0|2, standard signal, unsigned int, little endian) */
15065 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
15066 CAN_Sgn.UnsignedSgn &= 0x00000003;
15067 L4_MABX_B.SFunction1_o1_n5 = ((real_T) CAN_Sgn.UnsignedSgn);
15068
15069 /* ...... "SPN682_TransTrqConvLockupDisReq" (2|2, standard signal, unsigned int, little endian) */
15070 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
15071 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
15072 CAN_Sgn.UnsignedSgn &= 0x00000003;
15073 L4_MABX_B.SFunction1_o2_hw = ((real_T) CAN_Sgn.UnsignedSgn);
15074
15075 /* ...... "SPN683_DisengageDrivelineReq" (4|2, standard signal, unsigned int, little endian) */
15076 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
15077 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
15078 CAN_Sgn.UnsignedSgn &= 0x00000003;
15079 L4_MABX_B.SFunction1_o3_cg = ((real_T) CAN_Sgn.UnsignedSgn);
15080
15081 /* ...... "SPN4242_TransRevGearShiftInhibRq" (6|2, standard signal, unsigned int, little endian) */
15082 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
15083 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
15084 CAN_Sgn.UnsignedSgn &= 0x00000003;
15085 L4_MABX_B.SFunction1_o4_eq = ((real_T) CAN_Sgn.UnsignedSgn);
15086
15087 /* ...... "SPN684_RequestedPercClutchSlip" (8|8, standard signal, unsigned int, little endian) */
15088 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
15089 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15090 L4_MABX_B.SFunction1_o5_o = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
15091
15092 /* ...... "SPN525_TransRequestedGear" (16|8, standard signal, unsigned int, little endian) */
15093 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
15094 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15095 L4_MABX_B.SFunction1_o6_c = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn) );
15096
15097 /* ...... "SPN685_DisengageDiffLockRqFrAx1" (24|2, standard signal, unsigned int, little endian) */
15098 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
15099 CAN_Sgn.UnsignedSgn &= 0x00000003;
15100 L4_MABX_B.SFunction1_o7_l = ((real_T) CAN_Sgn.UnsignedSgn);
15101
15102 /* ...... "SPN686_DisengageDiffLockRqFrAx2" (26|2, standard signal, unsigned int, little endian) */
15103 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
15104 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
15105 CAN_Sgn.UnsignedSgn &= 0x00000003;
15106 L4_MABX_B.SFunction1_o8_f = ((real_T) CAN_Sgn.UnsignedSgn);
15107
15108 /* ...... "SPN687_DisengageDiffLockRqRrAx1" (28|2, standard signal, unsigned int, little endian) */
15109 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
15110 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
15111 CAN_Sgn.UnsignedSgn &= 0x00000003;
15112 L4_MABX_B.SFunction1_o9_g = ((real_T) CAN_Sgn.UnsignedSgn);
15113
15114 /* ...... "SPN688_DisengageDiffLockRqRrAx2" (30|2, standard signal, unsigned int, little endian) */
15115 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
15116 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
15117 CAN_Sgn.UnsignedSgn &= 0x00000003;
15118 L4_MABX_B.SFunction1_o10_k = ((real_T) CAN_Sgn.UnsignedSgn);
15119
15120 /* ...... "SPN689_DisengageDiffLockRqC" (32|2, standard signal, unsigned int, little endian) */
15121 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
15122 CAN_Sgn.UnsignedSgn &= 0x00000003;
15123 L4_MABX_B.SFunction1_o11 = ((real_T) CAN_Sgn.UnsignedSgn);
15124
15125 /* ...... "SPN690_DisengageDiffLockRqCF" (34|2, standard signal, unsigned int, little endian) */
15126 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
15127 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
15128 CAN_Sgn.UnsignedSgn &= 0x00000003;
15129 L4_MABX_B.SFunction1_o12 = ((real_T) CAN_Sgn.UnsignedSgn);
15130
15131 /* ...... "SPN691_DisengageDiffLockRqCR" (36|2, standard signal, unsigned int, little endian) */
15132 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
15133 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
15134 CAN_Sgn.UnsignedSgn &= 0x00000003;
15135 L4_MABX_B.SFunction1_o13 = ((real_T) CAN_Sgn.UnsignedSgn);
15136
15137 /* ...... "SPN5762_TransLoadRedInhibitRq" (38|2, standard signal, unsigned int, little endian) */
15138 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
15139 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
15140 CAN_Sgn.UnsignedSgn &= 0x00000003;
15141 L4_MABX_B.SFunction1_o14 = ((real_T) CAN_Sgn.UnsignedSgn);
15142
15143 /* ...... "SPN1852_TransmissionMode1" (40|2, standard signal, unsigned int, little endian) */
15144 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
15145 CAN_Sgn.UnsignedSgn &= 0x00000003;
15146 L4_MABX_B.SFunction1_o15 = ((real_T) CAN_Sgn.UnsignedSgn);
15147
15148 /* ...... "SPN1853_TransmissionMode2" (42|2, standard signal, unsigned int, little endian) */
15149 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
15150 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
15151 CAN_Sgn.UnsignedSgn &= 0x00000003;
15152 L4_MABX_B.SFunction1_o16 = ((real_T) CAN_Sgn.UnsignedSgn);
15153
15154 /* ...... "SPN1854_TransmissionMode3" (44|2, standard signal, unsigned int, little endian) */
15155 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
15156 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
15157 CAN_Sgn.UnsignedSgn &= 0x00000003;
15158 L4_MABX_B.SFunction1_o17 = ((real_T) CAN_Sgn.UnsignedSgn);
15159
15160 /* ...... "SPN1855_TransmissionMode4" (46|2, standard signal, unsigned int, little endian) */
15161 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
15162 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
15163 CAN_Sgn.UnsignedSgn &= 0x00000003;
15164 L4_MABX_B.SFunction1_o18 = ((real_T) CAN_Sgn.UnsignedSgn);
15165
15166 /* ...... "SPN7695_TransAutoNeutralRequest" (48|2, standard signal, unsigned int, little endian) */
15167 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
15168 CAN_Sgn.UnsignedSgn &= 0x00000003;
15169 L4_MABX_B.SFunction1_o19 = ((real_T) CAN_Sgn.UnsignedSgn);
15170
15171 /* ...... "SPN4255_TransRequestedLaunchGear" (50|4, standard signal, unsigned int, little endian) */
15172 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
15173 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
15174 CAN_Sgn.UnsignedSgn &= 0x0000000F;
15175 L4_MABX_B.SFunction1_o20 = ((real_T) CAN_Sgn.UnsignedSgn);
15176
15177 /* ...... "SPN2985_TransShiftSelDispModeSw" (54|2, standard signal, unsigned int, little endian) */
15178 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
15179 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
15180 CAN_Sgn.UnsignedSgn &= 0x00000003;
15181 L4_MABX_B.SFunction1_o21 = ((real_T) CAN_Sgn.UnsignedSgn);
15182
15183 /* ...... "SPN4246_TransmissionMode5" (56|2, standard signal, unsigned int, little endian) */
15184 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
15185 CAN_Sgn.UnsignedSgn &= 0x00000003;
15186 L4_MABX_B.SFunction1_o22 = ((real_T) CAN_Sgn.UnsignedSgn);
15187
15188 /* ...... "SPN4247_TransmissionMode6" (58|2, standard signal, unsigned int, little endian) */
15189 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
15190 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
15191 CAN_Sgn.UnsignedSgn &= 0x00000003;
15192 L4_MABX_B.SFunction1_o23 = ((real_T) CAN_Sgn.UnsignedSgn);
15193
15194 /* ...... "SPN4248_TransmissionMode7" (60|2, standard signal, unsigned int, little endian) */
15195 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
15196 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
15197 CAN_Sgn.UnsignedSgn &= 0x00000003;
15198 L4_MABX_B.SFunction1_o24 = ((real_T) CAN_Sgn.UnsignedSgn);
15199
15200 /* ...... "SPN4249_TransmissionMode8" (62|2, standard signal, unsigned int, little endian) */
15201 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
15202 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
15203 CAN_Sgn.UnsignedSgn &= 0x00000003;
15204 L4_MABX_B.SFunction1_o25 = ((real_T) CAN_Sgn.UnsignedSgn);
15205 }
15206 }
15207 } else {
15208 /* set RX status to 0 because no new message has arrived */
15209 L4_MABX_B.SFunction1_o26 = 0.0;
15210 }
15211 }
15212 }
15213
15214 /* End of Constant: '<S455>/Constant' */
15215 /* End of Outputs for SubSystem: '<S640>/TC1_03_05' */
15216
15217 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_50ms' */
15218
15219 /* RateTransition: '<S1054>/TmpRTBAtCCVS1_E3Inport1' */
15220 if (L4_MABX_M->Timing.RateInteraction.TID0_2 == 1) {
15221 L4_MABX_B.TwoSpeedAxleSwitch = L4_MABX_B.SFunction1_o1_fl;
15222 L4_MABX_B.ParkingBrakeSwitch = L4_MABX_B.SFunction1_o2_bu;
15223 L4_MABX_B.CruiseCtrlPauseSwitch = L4_MABX_B.SFunction1_o3_ko;
15224 L4_MABX_B.ParkBrakeReleaseInhibitRq = L4_MABX_B.SFunction1_o4_kv;
15225 L4_MABX_B.WheelBasedVehicleSpeed_j = WheelBasedVehicleSpeed;
15226 L4_MABX_B.CruiseCtrlActive = L4_MABX_B.SFunction1_o6_mm;
15227 L4_MABX_B.CruiseCtrlEnableSwitch_i = L4_MABX_B.SFunction1_o7_m1;
15228 L4_MABX_B.BrakeSwitch_m = BrakeSwitch;
15229 L4_MABX_B.ClutchSwitch = L4_MABX_B.SFunction1_o9_py;
15230 L4_MABX_B.CruiseCtrlSetSwitch = L4_MABX_B.SFunction1_o10_a;
15231 L4_MABX_B.CruiseCtrlCoastSwitch = L4_MABX_B.SFunction1_o11_mi;
15232 L4_MABX_B.CruiseCtrlResumeSwitch = L4_MABX_B.SFunction1_o12_k;
15233 L4_MABX_B.CruiseCtrlAccelerateSwitch = L4_MABX_B.SFunction1_o13_gj;
15234 L4_MABX_B.CruiseCtrlSetSpeed = L4_MABX_B.SFunction1_o14_e;
15235 L4_MABX_B.PTOGovernorState = L4_MABX_B.SFunction1_o15_pj;
15236 L4_MABX_B.CruiseCtrlStates = L4_MABX_B.SFunction1_o16_g;
15237 L4_MABX_B.EngIdleIncrementSwitch = L4_MABX_B.SFunction1_o17_k;
15238 L4_MABX_B.EngIdleDecrementSwitch = L4_MABX_B.SFunction1_o18_e;
15239 L4_MABX_B.EngTestModeSwitch = L4_MABX_B.SFunction1_o19_a;
15240 L4_MABX_B.EngShutdownOverrideSwitch = L4_MABX_B.SFunction1_o20_f;
15241 L4_MABX_B.SPN681_TransGearShiftInhibitReq = L4_MABX_B.SFunction1_o1_n5;
15242 L4_MABX_B.SPN682_TransTrqConvLockupDisReq = L4_MABX_B.SFunction1_o2_hw;
15243 L4_MABX_B.SPN683_DisengageDrivelineReq = L4_MABX_B.SFunction1_o3_cg;
15244 L4_MABX_B.SPN4242_TransRevGearShiftInhibR = L4_MABX_B.SFunction1_o4_eq;
15245 L4_MABX_B.SPN684_RequestedPercClutchSlip = L4_MABX_B.SFunction1_o5_o;
15246 L4_MABX_B.SPN525_TransRequestedGear = L4_MABX_B.SFunction1_o6_c;
15247 L4_MABX_B.SPN685_DisengageDiffLockRqFrAx1 = L4_MABX_B.SFunction1_o7_l;
15248 L4_MABX_B.SPN686_DisengageDiffLockRqFrAx2 = L4_MABX_B.SFunction1_o8_f;
15249 L4_MABX_B.SPN687_DisengageDiffLockRqRrAx1 = L4_MABX_B.SFunction1_o9_g;
15250 L4_MABX_B.SPN688_DisengageDiffLockRqRrAx2 = L4_MABX_B.SFunction1_o10_k;
15251 L4_MABX_B.SPN689_DisengageDiffLockRqC = L4_MABX_B.SFunction1_o11;
15252 L4_MABX_B.SPN690_DisengageDiffLockRqCF = L4_MABX_B.SFunction1_o12;
15253 L4_MABX_B.SPN691_DisengageDiffLockRqCR = L4_MABX_B.SFunction1_o13;
15254 L4_MABX_B.SPN5762_TransLoadRedInhibitRq = L4_MABX_B.SFunction1_o14;
15255 L4_MABX_B.SPN1852_TransmissionMode1 = L4_MABX_B.SFunction1_o15;
15256 L4_MABX_B.SPN1853_TransmissionMode2 = L4_MABX_B.SFunction1_o16;
15257 L4_MABX_B.SPN1854_TransmissionMode3 = L4_MABX_B.SFunction1_o17;
15258 L4_MABX_B.SPN1855_TransmissionMode4 = L4_MABX_B.SFunction1_o18;
15259 L4_MABX_B.SPN7695_TransAutoNeutralRequest = L4_MABX_B.SFunction1_o19;
15260 L4_MABX_B.SPN4255_TransRequestedLaunchGea = L4_MABX_B.SFunction1_o20;
15261 L4_MABX_B.SPN2985_TransShiftSelDispModeSw = L4_MABX_B.SFunction1_o21;
15262 L4_MABX_B.SPN4246_TransmissionMode5 = L4_MABX_B.SFunction1_o22;
15263 L4_MABX_B.SPN4247_TransmissionMode6 = L4_MABX_B.SFunction1_o23;
15264 L4_MABX_B.SPN4248_TransmissionMode7 = L4_MABX_B.SFunction1_o24;
15265 L4_MABX_B.SPN4249_TransmissionMode8 = L4_MABX_B.SFunction1_o25;
15266 }
15267
15268 /* End of Outputs for SubSystem: '<S849>/CAN_TX_50ms' */
15269
15270 /* Outputs for Enabled SubSystem: '<S638>/SystemTime_01' incorporates:
15271 * EnablePort: '<S639>/Enable'
15272 */
15273 /* Constant: '<S454>/Constant' */
15274 if (L4_MABX_P.Constant_Value_ez > 0.0) {
15275 /* S-Function (rti_commonblock): '<S639>/S-Function1' */
15276 /* This comment workarounds a code generation problem */
15277
15278 /* dSPACE RTICAN RX Message Block: "SystemTime_01" Id:233836544 */
15279 {
15280 UInt32 *CAN_Msg;
15281 static dsfloat time_old = 0.0;
15282
15283 /* Read status and timestamp info (previous message) */
15284 if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].timestamp !=
15285 time_old) {
15286 /* ... save timestamp info for the calculation of the RX status
15287 during the consecutive sample hit*/
15288 time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].
15289 timestamp;
15290
15291 /* ... set the processed flag to one */
15292 L4_MABX_B.SFunction1_o5_p = 1.0;
15293 L4_MABX_B.SFunction1_o6_f = (real_T)
15294 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].timestamp;
15295 L4_MABX_B.SFunction1_o7_h = (real_T)
15296 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].deltatime;
15297 CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0xDF01000].data;
15298
15299 /* Decode CAN message */
15300 {
15301 {
15302 rtican_Signal_t CAN_Sgn;
15303
15304 /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */
15305 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
15306 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15307 L4_MABX_B.SFunction1_o1_lg = ((real_T) CAN_Sgn.UnsignedSgn);
15308
15309 /* ...... "Source" (8|4, standard signal, unsigned int, little endian) */
15310 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
15311 CAN_Sgn.UnsignedSgn &= 0x0000000F;
15312 L4_MABX_B.SFunction1_o2_lu = ((real_T) CAN_Sgn.UnsignedSgn);
15313
15314 /* ...... "Date" (16|16, standard signal, unsigned int, little endian) */
15315 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
15316 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
15317 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
15318 L4_MABX_B.SFunction1_o3_ct = ((real_T) CAN_Sgn.UnsignedSgn);
15319
15320 /* ...... "Time" (32|32, standard signal, unsigned int, little endian) */
15321 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
15322 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
15323 CAN_Sgn.SgnBytes.Byte2 = CAN_Msg[6];
15324 CAN_Sgn.SgnBytes.Byte3 = CAN_Msg[7];
15325 L4_MABX_B.SFunction1_o4_os = 0.0001 * ( ((real_T)
15326 CAN_Sgn.UnsignedSgn) );
15327 }
15328 }
15329 } else {
15330 /* set RX status to 0 because no new message has arrived */
15331 L4_MABX_B.SFunction1_o5_p = 0.0;
15332 }
15333 }
15334 }
15335
15336 /* End of Constant: '<S454>/Constant' */
15337 /* End of Outputs for SubSystem: '<S638>/SystemTime_01' */
15338
15339 /* DataTypeConversion: '<S638>/Data Type Conversion8' */
15340 L4_MABX_B.RX_status_c = (L4_MABX_B.SFunction1_o5_p != 0.0);
15341
15342 /* Logic: '<S1068>/Operator' incorporates:
15343 * Constant: '<S1066>/Constant'
15344 */
15345 L4_MABX_B.Operator_iq = (L4_MABX_P.Constant_Value_i1 && L4_MABX_B.RX_status_c);
15346
15347 /* DataTypeConversion: '<S1068>/DataType' */
15348 L4_MABX_B.DataType_k3 = L4_MABX_B.Operator_iq;
15349
15350 /* Outputs for Enabled SubSystem: '<S1067>/Std_SystemTime_01' incorporates:
15351 * EnablePort: '<S1069>/Enable'
15352 */
15353 if (L4_MABX_B.DataType_k3) {
15354 /* S-Function (rti_commonblock): '<S1069>/S-Function1' incorporates:
15355 * Constant: '<S1067>/Constant'
15356 * Constant: '<S1067>/Constant1'
15357 */
15358 /* This comment workarounds a code generation problem */
15359
15360 /* dSPACE RTICAN TX Message Block: "Std_SystemTime_01" Id:5 */
15361 {
15362 static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
15363 0x00 };
15364
15365 Float32 delayTime = 0.0;
15366
15367 /* link this pointer to CAN_Msg for use in initialize_io_units() */
15368 CANTP1_PTR_M3_C2_STD_0x5 = &(CAN_Msg[0]);
15369
15370 /* ... perform loop-back if required */
15371 if (L4_MABX_P.Constant1_Value_mf > 0.5) {
15372 /* ... updating the used tx-clientbuffer */
15373 can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_STD_0X5->module,
15374 CANTP1_TX_M3_C2_MCRCLT_STD_0X5->queue );
15375
15376 /* ... Read status and timestamp info perform loop-back (previous message) */
15377 can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_STD_0X5,
15378 8, // datalen
15379 &(CAN_Msg[0]),
15380 CANTP1_RX_SPMSG_M3_C2_STD);
15381
15382 /* Convert timestamp */
15383 if (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->processed) {
15384 CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp =
15385 rtk_dsts_time_to_simtime_convert
15386 (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp);
15387 }
15388 } else {
15389 /* ... Read status and timestamp info (previous message) */
15390 can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_STD_0X5);
15391
15392 /* Convert timestamp */
15393 if (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->processed) {
15394 CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp =
15395 rtk_dsts_time_to_simtime_convert
15396 (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp);
15397 }
15398 }
15399
15400 /* Messages with timestamp zero have been received in pause/stop state
15401 and must not be handled.
15402 */
15403 if (CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp > 0.0) {
15404 L4_MABX_B.SFunction1_o1_a = (real_T)
15405 CANTP1_TX_M3_C2_MCRCLT_STD_0X5->processed;
15406 L4_MABX_B.SFunction1_o2_k = (real_T)
15407 CANTP1_TX_M3_C2_MCRCLT_STD_0X5->timestamp;
15408 L4_MABX_B.SFunction1_o3 = (real_T)
15409 CANTP1_TX_M3_C2_MCRCLT_STD_0X5->deltatime;
15410 L4_MABX_B.SFunction1_o4 = (real_T)
15411 CANTP1_TX_M3_C2_MCRCLT_STD_0X5->delaytime;
15412 }
15413
15414 /* ... Encode Simulink signals of TX and RM blocks*/
15415 {
15416 rtican_Signal_t CAN_Sgn;
15417 UInt32 i;
15418
15419 /* Initialize the static message data to zero */
15420 for (i=0; i<8; i++ )
15421 CAN_Msg[i] = 0;
15422
15423 /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */
15424 /* Add or substract 0.5 in order to round to nearest integer */
15425 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o1_lg ) + 0.5);
15426 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15427 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
15428
15429 /* ...... "Source" (8|4, standard signal, unsigned int, little endian) */
15430 /* Add or substract 0.5 in order to round to nearest integer */
15431 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o2_lu ) + 0.5);
15432 CAN_Sgn.UnsignedSgn &= 0x0000000F;
15433 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
15434
15435 /* ...... "Date" (16|16, standard signal, unsigned int, little endian) */
15436 /* Add or substract 0.5 in order to round to nearest integer */
15437 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o3_ct ) + 0.5);
15438 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
15439 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
15440 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1;
15441
15442 /* ...... "Time" (32|32, standard signal, unsigned int, little endian) */
15443 /* Add or substract 0.5 in order to round to nearest integer */
15444 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SFunction1_o4_os - ( 0 ) ) /
15445 0.0001 + 0.5);
15446 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
15447 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1;
15448 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte2;
15449 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte3;
15450 }
15451
15452 delayTime = (Float32) L4_MABX_P.Constant_Value_m1 / (2000);
15453
15454 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
15455 can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X5], 8, &(CAN_Msg[0]),
15456 delayTime);
15457 }
15458 }
15459
15460 /* End of Outputs for SubSystem: '<S1067>/Std_SystemTime_01' */
15461
15462 /* Constant: '<S1058>/Byte1' */
15463 L4_MABX_B.VectorConcatenate[0] = L4_MABX_P.Byte1_Value_m;
15464
15465 /* Constant: '<S1058>/Byte2' */
15466 L4_MABX_B.VectorConcatenate[1] = L4_MABX_P.Byte2_Value_j;
15467
15468 /* Constant: '<S1058>/Byte3' */
15469 L4_MABX_B.VectorConcatenate[2] = L4_MABX_P.Byte3_Value_p;
15470
15471 /* Constant: '<S1058>/Byte4' */
15472 L4_MABX_B.VectorConcatenate[3] = L4_MABX_P.Byte4_Value_f;
15473
15474 /* Constant: '<S1058>/Byte5' */
15475 L4_MABX_B.VectorConcatenate[4] = L4_MABX_P.Byte5_Value_p;
15476
15477 /* Constant: '<S1058>/Byte6' */
15478 L4_MABX_B.VectorConcatenate[5] = L4_MABX_P.Byte6_Value_g;
15479
15480 /* Constant: '<S1058>/Byte7' */
15481 L4_MABX_B.VectorConcatenate[6] = L4_MABX_P.Byte7_Value_h;
15482
15483 /* Constant: '<S1058>/Byte8' */
15484 L4_MABX_B.VectorConcatenate[7] = L4_MABX_P.Byte8_Value_p;
15485
15486 /* DataTypeConversion: '<S1062>/Data Type Conversion' */
15487 for (i = 0; i < 8; i++) {
15488 L4_MABX_B.DataTypeConversion[i] = L4_MABX_B.VectorConcatenate[i];
15489 }
15490
15491 /* End of DataTypeConversion: '<S1062>/Data Type Conversion' */
15492
15493 /* UnitDelay: '<S859>/Unit Delay2' */
15494 L4_MABX_B.UnitDelay2 = L4_MABX_DW.UnitDelay2_DSTATE;
15495
15496 /* Outputs for Triggered SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' incorporates:
15497 * TriggerPort: '<S1064>/Trigger'
15498 */
15499 zcEvent = (L4_MABX_B.UnitDelay2 &&
15500 (L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE_e != POS_ZCSIG));
15501 if (zcEvent) {
15502 /* S-Function (rti_commonblock): '<S1064>/S-Function1' */
15503 /* This comment workarounds a code generation problem */
15504
15505 /* dSPACE RTICAN TX Message Block: "TX Message" Id:418184965 */
15506 {
15507 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
15508
15509 Float32 delayTime = 0.0;
15510
15511 /* ... Read status and timestamp info (previous message) */
15512 can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]);
15513
15514 /* Convert timestamp */
15515 if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->processed) {
15516 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp =
15517 rtk_dsts_time_to_simtime_convert
15518 (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp);
15519 }
15520
15521 /* Messages with timestamp zero have been received in pause/stop state
15522 and must not be handled.
15523 */
15524 if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp > 0.0) {
15525 L4_MABX_B.SFunction1_o1_h = (real_T)
15526 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->processed;
15527 L4_MABX_B.SFunction1_o2_jd = (real_T)
15528 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->timestamp;
15529 L4_MABX_B.SFunction1_o3_h = (real_T)
15530 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->deltatime;
15531 L4_MABX_B.SFunction1_o4_p = (real_T)
15532 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05]->delaytime;
15533 }
15534
15535 /* ... Encode Simulink signals of TX and RM blocks*/
15536 {
15537 rtican_Signal_t CAN_Sgn;
15538
15539 /* ...... "Byte1" (0|8, standard signal, unsigned int, little endian) */
15540 /* Add or substract 0.5 in order to round to nearest integer */
15541 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[0] ) +
15542 0.5);
15543 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15544 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
15545
15546 /* ...... "Byte2" (8|8, standard signal, unsigned int, little endian) */
15547 /* Add or substract 0.5 in order to round to nearest integer */
15548 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[1] ) +
15549 0.5);
15550 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15551 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
15552
15553 /* ...... "Byte3" (16|8, standard signal, unsigned int, little endian) */
15554 /* Add or substract 0.5 in order to round to nearest integer */
15555 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[2] ) +
15556 0.5);
15557 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15558 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
15559
15560 /* ...... "Byte4" (24|8, standard signal, unsigned int, little endian) */
15561 /* Add or substract 0.5 in order to round to nearest integer */
15562 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[3] ) +
15563 0.5);
15564 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15565 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
15566
15567 /* ...... "Byte5" (32|8, standard signal, unsigned int, little endian) */
15568 /* Add or substract 0.5 in order to round to nearest integer */
15569 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[4] ) +
15570 0.5);
15571 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15572 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
15573
15574 /* ...... "Byte6" (40|8, standard signal, unsigned int, little endian) */
15575 /* Add or substract 0.5 in order to round to nearest integer */
15576 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[5] ) +
15577 0.5);
15578 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15579 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
15580
15581 /* ...... "Byte7" (48|8, standard signal, unsigned int, little endian) */
15582 /* Add or substract 0.5 in order to round to nearest integer */
15583 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[6] ) +
15584 0.5);
15585 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15586 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
15587
15588 /* ...... "Byte8" (56|8, standard signal, unsigned int, little endian) */
15589 /* Add or substract 0.5 in order to round to nearest integer */
15590 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion[7] ) +
15591 0.5);
15592 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15593 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
15594 }
15595
15596 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
15597 can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05], 8,
15598 &(CAN_Msg[0]), delayTime);
15599 }
15600 }
15601
15602 L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE_e = L4_MABX_B.UnitDelay2;
15603
15604 /* End of Outputs for SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' */
15605
15606 /* UnitDelay: '<S859>/Unit Delay1' */
15607 L4_MABX_B.UnitDelay1_i = L4_MABX_DW.UnitDelay1_DSTATE_d;
15608
15609 /* MultiPortSwitch: '<S859>/Multiport Switch' incorporates:
15610 * Constant: '<S1060>/Byte1'
15611 * Constant: '<S1060>/Byte2'
15612 * Constant: '<S1060>/Byte3'
15613 * Constant: '<S1060>/Byte4'
15614 * Constant: '<S1060>/Byte5'
15615 * Constant: '<S1060>/Byte6'
15616 * Constant: '<S1060>/Byte7'
15617 * Constant: '<S1060>/Byte8'
15618 * Constant: '<S1061>/Byte1'
15619 * Constant: '<S1061>/Byte2'
15620 * Constant: '<S1061>/Byte3'
15621 * Constant: '<S1061>/Byte4'
15622 * Constant: '<S1061>/Byte5'
15623 * Constant: '<S1061>/Byte6'
15624 * Constant: '<S1061>/Byte7'
15625 * Constant: '<S1061>/Byte8'
15626 */
15627 if (L4_MABX_B.UnitDelay1_i == 1) {
15628 L4_MABX_B.VectorConcatenate_l[7] = L4_MABX_P.Byte8_Value_e;
15629 L4_MABX_B.VectorConcatenate_l[6] = L4_MABX_P.Byte7_Value_b;
15630 L4_MABX_B.VectorConcatenate_l[5] = L4_MABX_P.Byte6_Value_c;
15631 L4_MABX_B.VectorConcatenate_l[4] = L4_MABX_P.Byte5_Value_e;
15632 L4_MABX_B.VectorConcatenate_l[3] = L4_MABX_P.Byte4_Value_c;
15633 L4_MABX_B.VectorConcatenate_l[2] = L4_MABX_P.Byte3_Value_c;
15634 L4_MABX_B.VectorConcatenate_l[1] = L4_MABX_P.Byte2_Value_n;
15635 L4_MABX_B.VectorConcatenate_l[0] = L4_MABX_P.Byte1_Value_e;
15636 for (i = 0; i < 8; i++) {
15637 L4_MABX_B.MultiportSwitch_g[i] = L4_MABX_B.VectorConcatenate_l[i];
15638 }
15639 } else {
15640 L4_MABX_B.VectorConcatenate_d[7] = L4_MABX_P.Byte8_Value;
15641 L4_MABX_B.VectorConcatenate_d[6] = L4_MABX_P.Byte7_Value;
15642 L4_MABX_B.VectorConcatenate_d[5] = L4_MABX_P.Byte6_Value;
15643 L4_MABX_B.VectorConcatenate_d[4] = L4_MABX_P.Byte5_Value;
15644 L4_MABX_B.VectorConcatenate_d[3] = L4_MABX_P.Byte4_Value;
15645 L4_MABX_B.VectorConcatenate_d[2] = L4_MABX_P.Byte3_Value;
15646 L4_MABX_B.VectorConcatenate_d[1] = L4_MABX_P.Byte2_Value;
15647 L4_MABX_B.VectorConcatenate_d[0] = L4_MABX_P.Byte1_Value;
15648 for (i = 0; i < 8; i++) {
15649 L4_MABX_B.MultiportSwitch_g[i] = L4_MABX_B.VectorConcatenate_d[i];
15650 }
15651 }
15652
15653 /* End of MultiPortSwitch: '<S859>/Multiport Switch' */
15654
15655 /* DataTypeConversion: '<S1063>/Data Type Conversion' */
15656 for (i = 0; i < 8; i++) {
15657 L4_MABX_B.DataTypeConversion_f[i] = L4_MABX_B.MultiportSwitch_g[i];
15658 }
15659
15660 /* End of DataTypeConversion: '<S1063>/Data Type Conversion' */
15661
15662 /* UnitDelay: '<S859>/Unit Delay3' */
15663 L4_MABX_B.UnitDelay3 = L4_MABX_DW.UnitDelay3_DSTATE;
15664
15665 /* Outputs for Triggered SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' incorporates:
15666 * TriggerPort: '<S1065>/Trigger'
15667 */
15668 zcEvent = (L4_MABX_B.UnitDelay3 &&
15669 (L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE != POS_ZCSIG));
15670 if (zcEvent) {
15671 /* S-Function (rti_commonblock): '<S1065>/S-Function1' */
15672 /* This comment workarounds a code generation problem */
15673
15674 /* dSPACE RTICAN TX Message Block: "TX Message" Id:418119429 */
15675 {
15676 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
15677
15678 Float32 delayTime = 0.0;
15679
15680 /* ... Read status and timestamp info (previous message) */
15681 can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]);
15682
15683 /* Convert timestamp */
15684 if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->processed) {
15685 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp =
15686 rtk_dsts_time_to_simtime_convert
15687 (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp);
15688 }
15689
15690 /* Messages with timestamp zero have been received in pause/stop state
15691 and must not be handled.
15692 */
15693 if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp > 0.0) {
15694 L4_MABX_B.SFunction1_o1_ac = (real_T)
15695 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->processed;
15696 L4_MABX_B.SFunction1_o2_br = (real_T)
15697 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->timestamp;
15698 L4_MABX_B.SFunction1_o3_m = (real_T)
15699 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->deltatime;
15700 L4_MABX_B.SFunction1_o4_j = (real_T)
15701 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05]->delaytime;
15702 }
15703
15704 /* ... Encode Simulink signals of TX and RM blocks*/
15705 {
15706 rtican_Signal_t CAN_Sgn;
15707
15708 /* ...... "Byte1" (0|8, standard signal, unsigned int, little endian) */
15709 /* Add or substract 0.5 in order to round to nearest integer */
15710 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_f[0] ) +
15711 0.5);
15712 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15713 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
15714
15715 /* ...... "Byte2" (8|8, standard signal, unsigned int, little endian) */
15716 /* Add or substract 0.5 in order to round to nearest integer */
15717 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_f[1] ) +
15718 0.5);
15719 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15720 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
15721
15722 /* ...... "Byte3" (16|8, standard signal, unsigned int, little endian) */
15723 /* Add or substract 0.5 in order to round to nearest integer */
15724 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_f[2] ) +
15725 0.5);
15726 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15727 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
15728
15729 /* ...... "Byte4" (24|8, standard signal, unsigned int, little endian) */
15730 /* Add or substract 0.5 in order to round to nearest integer */
15731 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_f[3] ) +
15732 0.5);
15733 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15734 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
15735
15736 /* ...... "Byte5" (32|8, standard signal, unsigned int, little endian) */
15737 /* Add or substract 0.5 in order to round to nearest integer */
15738 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_f[4] ) +
15739 0.5);
15740 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15741 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
15742
15743 /* ...... "Byte6" (40|8, standard signal, unsigned int, little endian) */
15744 /* Add or substract 0.5 in order to round to nearest integer */
15745 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_f[5] ) +
15746 0.5);
15747 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15748 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
15749
15750 /* ...... "Byte7" (48|8, standard signal, unsigned int, little endian) */
15751 /* Add or substract 0.5 in order to round to nearest integer */
15752 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_f[6] ) +
15753 0.5);
15754 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15755 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
15756
15757 /* ...... "Byte8" (56|8, standard signal, unsigned int, little endian) */
15758 /* Add or substract 0.5 in order to round to nearest integer */
15759 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_f[7] ) +
15760 0.5);
15761 CAN_Sgn.UnsignedSgn &= 0x000000FF;
15762 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
15763 }
15764
15765 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
15766 can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05], 8,
15767 &(CAN_Msg[0]), delayTime);
15768 }
15769 }
15770
15771 L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE = L4_MABX_B.UnitDelay3;
15772
15773 /* End of Outputs for SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' */
15774
15775 /* Chart: '<S859>/Chart' incorporates:
15776 * Constant: '<S859>/Constant1'
15777 */
15778 if (L4_MABX_DW.temporalCounter_i1_p < 255U) {
15779 L4_MABX_DW.temporalCounter_i1_p++;
15780 }
15781
15782 /* Gateway: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */
15783 /* During: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */
15784 if (L4_MABX_DW.is_active_c4_SUB_ECU_L4_MABX_HW == 0U) {
15785 /* Entry: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */
15786 L4_MABX_DW.is_active_c4_SUB_ECU_L4_MABX_HW = 1U;
15787
15788 /* Entry Internal: OUTPUTS_PIC_KW/CAN_Out_PIC_KW/CAN_TX_BAM/Chart */
15789 /* Transition: '<S1059>:4' */
15790 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_Init_k;
15791
15792 /* Entry 'Init': '<S1059>:1' */
15793 L4_MABX_B.State = 0U;
15794 L4_MABX_B.enTPCM = false;
15795 L4_MABX_B.enTPDT = false;
15796 L4_MABX_B.TPCM_ts_Prev = L4_MABX_B.SFunction1_o2_jd;
15797 L4_MABX_B.TPDT_ts_Prev = L4_MABX_B.SFunction1_o2_br;
15798 L4_MABX_B.TPDT_count = 0U;
15799 } else {
15800 switch (L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf) {
15801 case L4_MABX_IN_CheckPacketCount:
15802 L4_MABX_B.State = 6U;
15803
15804 /* During 'CheckPacketCount': '<S1059>:11' */
15805 if (L4_MABX_B.TPDT_count <= L4_MABX_P.Constant1_Value_m5) {
15806 /* Transition: '<S1059>:18' */
15807 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SendTPDT;
15808 L4_MABX_DW.temporalCounter_i1_p = 0U;
15809
15810 /* Entry 'SendTPDT': '<S1059>:6' */
15811 L4_MABX_B.State = 4U;
15812 L4_MABX_B.enTPDT = true;
15813 } else {
15814 /* Transition: '<S1059>:19' */
15815 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf =
15816 L4_MABX_IN_WaitForNextPeriod;
15817 L4_MABX_DW.temporalCounter_i1_p = 0U;
15818
15819 /* Entry 'WaitForNextPeriod': '<S1059>:17' */
15820 L4_MABX_B.State = 7U;
15821 }
15822 break;
15823
15824 case L4_MABX_IN_Init_k:
15825 /* During 'Init': '<S1059>:1' */
15826 /* Transition: '<S1059>:9' */
15827 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_StartMsg;
15828
15829 /* Entry 'StartMsg': '<S1059>:30' */
15830 L4_MABX_B.State = 1U;
15831 L4_MABX_B.TPDT_count = 1U;
15832 break;
15833
15834 case L4_MABX_IN_InterframeDelay:
15835 L4_MABX_B.State = 3U;
15836
15837 /* During 'InterframeDelay': '<S1059>:7' */
15838 if (L4_MABX_DW.temporalCounter_i1_p >= 5U) {
15839 /* Transition: '<S1059>:10' */
15840 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SendTPDT;
15841 L4_MABX_DW.temporalCounter_i1_p = 0U;
15842
15843 /* Entry 'SendTPDT': '<S1059>:6' */
15844 L4_MABX_B.State = 4U;
15845 L4_MABX_B.enTPDT = true;
15846 }
15847 break;
15848
15849 case L4_MABX_IN_InterframeDelay1:
15850 L4_MABX_B.State = 5U;
15851
15852 /* During 'InterframeDelay1': '<S1059>:12' */
15853 if (L4_MABX_DW.temporalCounter_i1_p >= 5U) {
15854 /* Transition: '<S1059>:14' */
15855 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_CheckPacketCount;
15856
15857 /* Entry 'CheckPacketCount': '<S1059>:11' */
15858 L4_MABX_B.State = 6U;
15859 i = (int32_T)(L4_MABX_B.TPDT_count + 1U);
15860 if ((uint32_T)i > 255U) {
15861 i = 255;
15862 }
15863
15864 L4_MABX_B.TPDT_count = (uint8_T)i;
15865 }
15866 break;
15867
15868 case L4_MABX_IN_SendTPCM:
15869 L4_MABX_B.State = 2U;
15870
15871 /* During 'SendTPCM': '<S1059>:5' */
15872 if (L4_MABX_DW.temporalCounter_i1_p >= 1U) {
15873 /* Transition: '<S1059>:8' */
15874 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_InterframeDelay;
15875 L4_MABX_DW.temporalCounter_i1_p = 0U;
15876
15877 /* Entry 'InterframeDelay': '<S1059>:7' */
15878 L4_MABX_B.State = 3U;
15879 L4_MABX_B.enTPCM = false;
15880 L4_MABX_B.TPCM_ts_Prev = L4_MABX_B.SFunction1_o2_jd;
15881 }
15882 break;
15883
15884 case L4_MABX_IN_SendTPDT:
15885 L4_MABX_B.State = 4U;
15886
15887 /* During 'SendTPDT': '<S1059>:6' */
15888 if (L4_MABX_DW.temporalCounter_i1_p >= 1U) {
15889 /* Transition: '<S1059>:13' */
15890 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_InterframeDelay1;
15891 L4_MABX_DW.temporalCounter_i1_p = 0U;
15892
15893 /* Entry 'InterframeDelay1': '<S1059>:12' */
15894 L4_MABX_B.State = 5U;
15895 L4_MABX_B.enTPDT = false;
15896 L4_MABX_B.TPDT_ts_Prev = L4_MABX_B.SFunction1_o2_br;
15897 }
15898 break;
15899
15900 case L4_MABX_IN_StartMsg:
15901 /* During 'StartMsg': '<S1059>:30' */
15902 /* Transition: '<S1059>:31' */
15903 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_SendTPCM;
15904 L4_MABX_DW.temporalCounter_i1_p = 0U;
15905
15906 /* Entry 'SendTPCM': '<S1059>:5' */
15907 L4_MABX_B.State = 2U;
15908 L4_MABX_B.enTPCM = true;
15909 break;
15910
15911 default:
15912 L4_MABX_B.State = 7U;
15913
15914 /* During 'WaitForNextPeriod': '<S1059>:17' */
15915 if (L4_MABX_DW.temporalCounter_i1_p >= 185U) {
15916 /* Transition: '<S1059>:20' */
15917 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_StartMsg;
15918
15919 /* Entry 'StartMsg': '<S1059>:30' */
15920 L4_MABX_B.State = 1U;
15921 L4_MABX_B.TPDT_count = 1U;
15922 }
15923 break;
15924 }
15925 }
15926
15927 /* End of Chart: '<S859>/Chart' */
15928
15929 /* RateTransition: '<S1077>/TmpRTBAtFlashOutport1' */
15930 if (L4_MABX_M->Timing.RateInteraction.TID0_3 == 1) {
15931 L4_MABX_B.TmpRTBAtFlashOutport1 = L4_MABX_DW.TmpRTBAtFlashOutport1_Buffer0;
15932 }
15933
15934 /* End of RateTransition: '<S1077>/TmpRTBAtFlashOutport1' */
15935
15936 /* RelationalOperator: '<S1085>/Operator' incorporates:
15937 * Constant: '<S1077>/Manual Ready'
15938 */
15939 L4_MABX_B.Operator_n4 = (L4_MABX_P.ManualReady_Value == SupervisorMode);
15940
15941 /* Logic: '<S1077>/AND3' */
15942 L4_MABX_B.AND3 = ((L4_MABX_B.TmpRTBAtFlashOutport1 != 0.0) &&
15943 L4_MABX_B.Operator_n4);
15944
15945 /* Logic: '<S1077>/NOT2' */
15946 L4_MABX_B.NOT2 = !L4_MABX_B.Operator_n4;
15947
15948 /* Logic: '<S1077>/OR1' */
15949 L4_MABX_B.OR1_o = (L4_MABX_B.AND3 || L4_MABX_B.NOT2);
15950
15951 /* Logic: '<S1077>/NOT1' */
15952 L4_MABX_B.NOT1 = !L4_MABX_B.AutonomousEnabled_d;
15953
15954 /* RelationalOperator: '<S1086>/Operator' incorporates:
15955 * Constant: '<S1077>/Constant2'
15956 */
15957 L4_MABX_B.Operator_kk = (L4_MABX_P.Constant2_Value_i == MABX_Mode);
15958
15959 /* Logic: '<S1077>/NOT' */
15960 L4_MABX_B.NOT_p = !L4_MABX_B.Operator_kk;
15961
15962 /* Logic: '<S1077>/AND1' */
15963 L4_MABX_B.AND1 = (L4_MABX_B.OR1_o && EnableSw && L4_MABX_B.NOT1 &&
15964 L4_MABX_B.NOT_p);
15965
15966 /* S-Function (rti_commonblock): '<S1070>/S-Function1' */
15967 /* This comment workarounds a code generation problem */
15968
15969 /* write output state value to digital output channel 1 on port 1 */
15970 dio_tp4_digout_write(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH1, (UInt16)
15971 (L4_MABX_B.AND1 << 0));
15972
15973 /* Logic: '<S1077>/AND' */
15974 L4_MABX_B.AND_b = (L4_MABX_B.AutonomousEnabled_d &&
15975 (L4_MABX_B.TmpRTBAtFlashOutport1 != 0.0));
15976
15977 /* Logic: '<S1077>/OR' */
15978 L4_MABX_B.OR = (L4_MABX_B.AND_b || AutonomousOutputEnabled);
15979
15980 /* Logic: '<S1077>/AND2' */
15981 L4_MABX_B.AND2_g = (L4_MABX_B.NOT_p && L4_MABX_B.OR);
15982
15983 /* S-Function (rti_commonblock): '<S1071>/S-Function1' */
15984 /* This comment workarounds a code generation problem */
15985
15986 /* write output state value to digital output channel 2 on port 1 */
15987 dio_tp4_digout_write(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH2, (UInt16)
15988 (L4_MABX_B.AND2_g << 1));
15989
15990 /* S-Function (rti_commonblock): '<S1072>/S-Function1' */
15991 /* This comment workarounds a code generation problem */
15992
15993 /* write output state value to digital output channel 6 on port 2 */
15994 dio_tp4_digout_write(DIO_TP4_1_MODULE_ADDR, 2, DIO_TP4_MASK_CH6, (UInt16)
15995 (L4_MABX_B.Operator_kk << 5));
15996
15997 /* Logic: '<S1075>/Logical Operator' */
15998 L4_MABX_B.LogicalOperator_j = !AutonomousOutputEnabled;
15999
16000 /* Outputs for Atomic SubSystem: '<S1075>/If_Then_Else4' */
16001
16002 /* Constant: '<S1075>/APTC_PEDAL_A_PWM_FREQ_HZ_APV' */
16003 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_j,
16004 L4_MABX_B.Pedal_1_pwm_freq_raw_value,
16005 L4_MABX_P.APTC_PEDAL_A_PWM_FREQ_HZ_APV_Va,
16006 &L4_MABX_B.If_Then_Else4);
16007
16008 /* End of Outputs for SubSystem: '<S1075>/If_Then_Else4' */
16009
16010 /* MinMax: '<S850>/MinMax' incorporates:
16011 * Constant: '<S850>/Constant2'
16012 */
16013 DeltaTime = L4_MABX_B.If_Then_Else4.Switch;
16014 PositionFinalLimited = L4_MABX_P.Constant2_Value_nm;
16015 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
16016 PositionFinalLimited = DeltaTime;
16017 }
16018
16019 L4_MABX_B.MinMax_k = PositionFinalLimited;
16020
16021 /* End of MinMax: '<S850>/MinMax' */
16022
16023 /* DataTypeConversion: '<S850>/Data Type Conversion1' */
16024 L4_MABX_B.DataTypeConversion1 = L4_MABX_B.MinMax_k;
16025
16026 /* Product: '<S850>/Divide' incorporates:
16027 * Constant: '<S850>/Constant3'
16028 */
16029 L4_MABX_B.Divide_k = L4_MABX_P.Constant3_Value_aj /
16030 L4_MABX_B.DataTypeConversion1;
16031
16032 /* DataTypeConversion: '<S850>/Data Type Conversion5' */
16033 L4_MABX_B.PWMOut_P2C1_Period = L4_MABX_B.Divide_k;
16034
16035 /* Lookup_n-D: '<S1075>/1-D Lookup Table2' */
16036 L4_MABX_B.PedalPWMA_DC_out = look1_binlcapw(L4_MABX_B.If_Then_Else_f.Switch,
16037 L4_MABX_P.uDLookupTable2_bp01Data, L4_MABX_P.uDLookupTable2_tableData, 1U);
16038
16039 /* Outputs for Atomic SubSystem: '<S1075>/If_Then_Else1' */
16040 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_j,
16041 L4_MABX_B.Pedal_1_pwm_dc_raw_value,
16042 L4_MABX_B.PedalPWMA_DC_out, &L4_MABX_B.If_Then_Else1_o);
16043
16044 /* End of Outputs for SubSystem: '<S1075>/If_Then_Else1' */
16045
16046 /* Gain: '<S850>/Gain1' */
16047 L4_MABX_B.Gain1_h = L4_MABX_P.Gain1_Gain_m * L4_MABX_B.If_Then_Else1_o.Switch;
16048
16049 /* DataTypeConversion: '<S850>/Data Type Conversion6' */
16050 L4_MABX_B.PWMOut_P2C1_DC = L4_MABX_B.Gain1_h;
16051
16052 /* S-Function (rti_commonblock): '<S1073>/S-Function1' */
16053 /* This comment workarounds a code generation problem */
16054
16055 /* write PWM Period and DutyCycle for output channel 1 on port 2 */
16056 dio_tp4_pwm_update(DIO_TP4_1_MODULE_ADDR , 2, 1, (real_T)
16057 L4_MABX_B.PWMOut_P2C1_Period, (real_T)
16058 L4_MABX_B.PWMOut_P2C1_DC);
16059
16060 /* Outputs for Atomic SubSystem: '<S1075>/If_Then_Else5' */
16061
16062 /* Constant: '<S1075>/APTC_PEDAL_B_PWM_FREQ_HZ_APV' */
16063 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_j,
16064 L4_MABX_B.Pedal_2_pwm_freq_raw_value,
16065 L4_MABX_P.APTC_PEDAL_B_PWM_FREQ_HZ_APV_Va,
16066 &L4_MABX_B.If_Then_Else5);
16067
16068 /* End of Outputs for SubSystem: '<S1075>/If_Then_Else5' */
16069
16070 /* MinMax: '<S850>/MinMax1' incorporates:
16071 * Constant: '<S850>/Constant4'
16072 */
16073 DeltaTime = L4_MABX_B.If_Then_Else5.Switch;
16074 PositionFinalLimited = L4_MABX_P.Constant4_Value_p;
16075 if ((DeltaTime > PositionFinalLimited) || rtIsNaN(PositionFinalLimited)) {
16076 PositionFinalLimited = DeltaTime;
16077 }
16078
16079 L4_MABX_B.MinMax1_hc = PositionFinalLimited;
16080
16081 /* End of MinMax: '<S850>/MinMax1' */
16082
16083 /* DataTypeConversion: '<S850>/Data Type Conversion2' */
16084 L4_MABX_B.DataTypeConversion2_c = L4_MABX_B.MinMax1_hc;
16085
16086 /* Product: '<S850>/Divide1' incorporates:
16087 * Constant: '<S850>/Constant1'
16088 */
16089 L4_MABX_B.Divide1 = L4_MABX_P.Constant1_Value_ib /
16090 L4_MABX_B.DataTypeConversion2_c;
16091
16092 /* DataTypeConversion: '<S850>/Data Type Conversion9' */
16093 L4_MABX_B.PWMOut_P2C2_Period = L4_MABX_B.Divide1;
16094
16095 /* Lookup_n-D: '<S1075>/1-D Lookup Table3' */
16096 L4_MABX_B.PedalPWMB_DC_out = look1_binlcapw(L4_MABX_B.If_Then_Else_f.Switch,
16097 L4_MABX_P.uDLookupTable3_bp01Data, L4_MABX_P.uDLookupTable3_tableData, 1U);
16098
16099 /* Outputs for Atomic SubSystem: '<S1075>/If_Then_Else2' */
16100 L4_MABX_If_Then_Else(L4_MABX_B.LogicalOperator_j,
16101 L4_MABX_B.Pedal_2_pwm_dc_raw_value,
16102 L4_MABX_B.PedalPWMB_DC_out, &L4_MABX_B.If_Then_Else2_i);
16103
16104 /* End of Outputs for SubSystem: '<S1075>/If_Then_Else2' */
16105
16106 /* Gain: '<S850>/Gain' */
16107 L4_MABX_B.Gain_go = L4_MABX_P.Gain_Gain_e * L4_MABX_B.If_Then_Else2_i.Switch;
16108
16109 /* DataTypeConversion: '<S850>/Data Type Conversion10' */
16110 L4_MABX_B.PWMOut_P2C2_DC = L4_MABX_B.Gain_go;
16111
16112 /* S-Function (rti_commonblock): '<S1074>/S-Function1' */
16113 /* This comment workarounds a code generation problem */
16114
16115 /* write PWM Period and DutyCycle for output channel 2 on port 2 */
16116 dio_tp4_pwm_update(DIO_TP4_1_MODULE_ADDR , 2, 2, (real_T)
16117 L4_MABX_B.PWMOut_P2C2_Period, (real_T)
16118 L4_MABX_B.PWMOut_P2C2_DC);
16119
16120 /* S-Function (rti_commonblock): '<S739>/S-Function1' */
16121 /* This comment workarounds a code generation problem */
16122
16123 /* Gain: '<S416>/ShifterControlDC' */
16124 L4_MABX_B.ShiftControlDC = L4_MABX_P.ShifterControlDC_Gain *
16125 L4_MABX_B.SFunction1_o2_b;
16126
16127 /* RelationalOperator: '<S1076>/Relational Operator' incorporates:
16128 * Constant: '<S1076>/Constant'
16129 */
16130 L4_MABX_B.RelationalOperator_g = (L4_MABX_B.ShiftControlDC >=
16131 L4_MABX_P.Constant_Value_m1r);
16132
16133 /* RelationalOperator: '<S1076>/Relational Operator1' incorporates:
16134 * Constant: '<S1076>/Constant1'
16135 */
16136 L4_MABX_B.RelationalOperator1_m = (L4_MABX_B.ShiftControlDC <=
16137 L4_MABX_P.Constant1_Value_dd);
16138
16139 /* Logic: '<S1076>/Logical Operator' */
16140 L4_MABX_B.LogicalOperator_iy = (L4_MABX_B.RelationalOperator_g &&
16141 L4_MABX_B.RelationalOperator1_m);
16142
16143 /* RelationalOperator: '<S1082>/Compare' incorporates:
16144 * Constant: '<S1082>/Constant'
16145 */
16146 L4_MABX_B.Compare_bx = (L4_MABX_B.SPN524_TransSelectedGear ==
16147 L4_MABX_P.Constant_Value_oi);
16148
16149 /* RelationalOperator: '<S1083>/Compare' incorporates:
16150 * Constant: '<S1083>/Constant'
16151 */
16152 L4_MABX_B.Compare_kv = (L4_MABX_B.SPN523_TransCurrentGear ==
16153 L4_MABX_P.Constant_Value_hf);
16154
16155 /* Logic: '<S1076>/Logical Operator1' */
16156 L4_MABX_B.LogicalOperator1_k = (L4_MABX_B.Compare_bx && L4_MABX_B.Compare_kv);
16157
16158 /* Outputs for Atomic SubSystem: '<S1076>/If_Then_Else' */
16159
16160 /* Constant: '<S1076>/F_ALLOW_ETC2_FOR_NEUTRAL_OUTPUT_APV' incorporates:
16161 * Constant: '<S1076>/Constant2'
16162 */
16163 L4_MABX_If_Then_Else3(L4_MABX_P.F_ALLOW_ETC2_FOR_NEUTRAL_OUTPUT,
16164 L4_MABX_B.LogicalOperator1_k,
16165 L4_MABX_P.Constant2_Value_f, &L4_MABX_B.If_Then_Else_l);
16166
16167 /* End of Outputs for SubSystem: '<S1076>/If_Then_Else' */
16168
16169 /* Logic: '<S1076>/Logical Operator2' */
16170 L4_MABX_B.Neutral = (L4_MABX_B.LogicalOperator_iy ||
16171 L4_MABX_B.If_Then_Else_l.Switch);
16172
16173 /* Logic: '<S850>/Logical Operator' */
16174 L4_MABX_B.LogicalOperator_l = !L4_MABX_B.Neutral;
16175
16176 /* Outputs for Enabled SubSystem: '<S573>/GNSSDOPs_011' incorporates:
16177 * EnablePort: '<S574>/Enable'
16178 */
16179 /* Constant: '<S441>/Constant' */
16180 if (L4_MABX_P.Constant_Value_ak > 0.0) {
16181 /* S-Function (rti_commonblock): '<S574>/S-Function1' */
16182 /* This comment workarounds a code generation problem */
16183
16184 /* dSPACE RTICAN RX Message Block: "GNSSDOPs_01" Id:435815168 */
16185 {
16186 UInt32 *CAN_Msg;
16187 static dsfloat time_old = 0.0;
16188
16189 /* Read status and timestamp info (previous message) */
16190 if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].timestamp !=
16191 time_old) {
16192 /* ... save timestamp info for the calculation of the RX status
16193 during the consecutive sample hit*/
16194 time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].
16195 timestamp;
16196
16197 /* ... set the processed flag to one */
16198 L4_MABX_B.SFunction1_o7_g = 1.0;
16199 L4_MABX_B.SFunction1_o8_a4 = (real_T)
16200 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].timestamp;
16201 L4_MABX_B.SFunction1_o9_p = (real_T)
16202 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].deltatime;
16203 CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0300].data;
16204
16205 /* Decode CAN message */
16206 {
16207 {
16208 rtican_Signal_t CAN_Sgn;
16209
16210 /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */
16211 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
16212 CAN_Sgn.UnsignedSgn &= 0x000000FF;
16213 L4_MABX_B.SFunction1_o1_nf = ((real_T) CAN_Sgn.UnsignedSgn);
16214
16215 /* ...... "SetMode" (8|3, standard signal, unsigned int, little endian) */
16216 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
16217 CAN_Sgn.UnsignedSgn &= 0x00000007;
16218 L4_MABX_B.SFunction1_o2_mj = ((real_T) CAN_Sgn.UnsignedSgn);
16219
16220 /* ...... "OpMode" (11|3, standard signal, unsigned int, little endian) */
16221 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
16222 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 3;
16223 CAN_Sgn.UnsignedSgn &= 0x00000007;
16224 L4_MABX_B.SFunction1_o3_l3 = ((real_T) CAN_Sgn.UnsignedSgn);
16225
16226 /* ...... "HDOP_" (16|16, standard signal, signed int, little endian) */
16227 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
16228 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
16229 CAN_Sgn.SignedSgn &= 0x0000FFFF;
16230 if (CAN_Sgn.SignedSgn >> 15) {
16231 CAN_Sgn.SignedSgn |= 0xFFFF0000;
16232 }
16233
16234 L4_MABX_B.SFunction1_o4_eg = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
16235
16236 /* ...... "VDOP" (32|16, standard signal, signed int, little endian) */
16237 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
16238 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
16239 CAN_Sgn.SignedSgn &= 0x0000FFFF;
16240 if (CAN_Sgn.SignedSgn >> 15) {
16241 CAN_Sgn.SignedSgn |= 0xFFFF0000;
16242 }
16243
16244 L4_MABX_B.SFunction1_o5_pl = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
16245
16246 /* ...... "TDOP" (48|16, standard signal, signed int, little endian) */
16247 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
16248 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7];
16249 CAN_Sgn.SignedSgn &= 0x0000FFFF;
16250 if (CAN_Sgn.SignedSgn >> 15) {
16251 CAN_Sgn.SignedSgn |= 0xFFFF0000;
16252 }
16253
16254 L4_MABX_B.SFunction1_o6_d = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
16255 }
16256 }
16257 } else {
16258 /* set RX status to 0 because no new message has arrived */
16259 L4_MABX_B.SFunction1_o7_g = 0.0;
16260 }
16261 }
16262 }
16263
16264 /* End of Outputs for SubSystem: '<S573>/GNSSDOPs_011' */
16265
16266 /* DataTypeConversion: '<S573>/Data Type Conversion8' */
16267 L4_MABX_B.RX_status_j = (L4_MABX_B.SFunction1_o7_g != 0.0);
16268
16269 /* Outputs for Enabled SubSystem: '<S573>/GNSSDOPs_1' incorporates:
16270 * EnablePort: '<S575>/Enable'
16271 */
16272 /* Constant: '<S441>/Constant' */
16273 if (L4_MABX_P.Constant_Value_ak > 0.0) {
16274 /* S-Function (rti_commonblock): '<S575>/S-Function1' */
16275 /* This comment workarounds a code generation problem */
16276
16277 /* dSPACE RTICAN RX Message Block: "GNSSDOPs_01" Id:435815169 */
16278 {
16279 UInt32 *CAN_Msg;
16280 static dsfloat time_old = 0.0;
16281
16282 /* Read status and timestamp info (previous message) */
16283 if (can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].timestamp !=
16284 time_old) {
16285 /* ... save timestamp info for the calculation of the RX status
16286 during the consecutive sample hit*/
16287 time_old = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].
16288 timestamp;
16289
16290 /* ... set the processed flag to one */
16291 L4_MABX_B.SFunction1_o7_jo = 1.0;
16292 L4_MABX_B.SFunction1_o8_pc = (real_T)
16293 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].timestamp;
16294 L4_MABX_B.SFunction1_o9_k = (real_T)
16295 can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].deltatime;
16296 CAN_Msg = can_type1_M2_C2_XTD[CANTP1_M2_C2_RXSRVC_XTD_0x19FA0301].data;
16297
16298 /* Decode CAN message */
16299 {
16300 {
16301 rtican_Signal_t CAN_Sgn;
16302
16303 /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */
16304 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
16305 CAN_Sgn.UnsignedSgn &= 0x000000FF;
16306 L4_MABX_B.SFunction1_o1_lr = ((real_T) CAN_Sgn.UnsignedSgn);
16307
16308 /* ...... "SetMode" (8|3, standard signal, unsigned int, little endian) */
16309 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
16310 CAN_Sgn.UnsignedSgn &= 0x00000007;
16311 L4_MABX_B.SFunction1_o2_mt = ((real_T) CAN_Sgn.UnsignedSgn);
16312
16313 /* ...... "OpMode" (11|3, standard signal, unsigned int, little endian) */
16314 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
16315 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 3;
16316 CAN_Sgn.UnsignedSgn &= 0x00000007;
16317 L4_MABX_B.SFunction1_o3_m3 = ((real_T) CAN_Sgn.UnsignedSgn);
16318
16319 /* ...... "HDOP_" (16|16, standard signal, signed int, little endian) */
16320 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
16321 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
16322 CAN_Sgn.SignedSgn &= 0x0000FFFF;
16323 if (CAN_Sgn.SignedSgn >> 15) {
16324 CAN_Sgn.SignedSgn |= 0xFFFF0000;
16325 }
16326
16327 L4_MABX_B.SFunction1_o4_ey = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
16328
16329 /* ...... "VDOP" (32|16, standard signal, signed int, little endian) */
16330 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
16331 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
16332 CAN_Sgn.SignedSgn &= 0x0000FFFF;
16333 if (CAN_Sgn.SignedSgn >> 15) {
16334 CAN_Sgn.SignedSgn |= 0xFFFF0000;
16335 }
16336
16337 L4_MABX_B.SFunction1_o5_g5 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
16338
16339 /* ...... "TDOP" (48|16, standard signal, signed int, little endian) */
16340 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
16341 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7];
16342 CAN_Sgn.SignedSgn &= 0x0000FFFF;
16343 if (CAN_Sgn.SignedSgn >> 15) {
16344 CAN_Sgn.SignedSgn |= 0xFFFF0000;
16345 }
16346
16347 L4_MABX_B.SFunction1_o6_b = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
16348 }
16349 }
16350 } else {
16351 /* set RX status to 0 because no new message has arrived */
16352 L4_MABX_B.SFunction1_o7_jo = 0.0;
16353 }
16354 }
16355 }
16356
16357 /* End of Outputs for SubSystem: '<S573>/GNSSDOPs_1' */
16358
16359 /* Switch: '<S573>/Switch' */
16360 if (L4_MABX_B.RX_status_j) {
16361 L4_MABX_B.HDOP_ = L4_MABX_B.SFunction1_o4_eg;
16362 } else {
16363 L4_MABX_B.HDOP_ = L4_MABX_B.SFunction1_o4_ey;
16364 }
16365
16366 /* Outputs for Atomic SubSystem: '<S65>/Task_20ms' */
16367 /* RateTransition: '<S395>/TmpRTBAtCheckHDOPInport1' */
16368 if (L4_MABX_M->Timing.RateInteraction.TID0_1 == 1) {
16369 L4_MABX_B.HDOP__f = L4_MABX_B.HDOP_;
16370 L4_MABX_B.FrontAxleSpeed_d = L4_MABX_B.SFunction1_o1_ie;
16371 L4_MABX_B.FrontAxleSpeed_dv = L4_MABX_B.SFunction1_o1_ie;
16372 L4_MABX_B.FrontAxleSpeed_dvq = L4_MABX_B.SFunction1_o1_ie;
16373 L4_MABX_B.TmpRTBAtVehHeadingInport1 = YawRate;
16374 }
16375
16376 /* End of RateTransition: '<S395>/TmpRTBAtCheckHDOPInport1' */
16377 /* End of Outputs for SubSystem: '<S65>/Task_20ms' */
16378
16379 /* Switch: '<S397>/Switch2' incorporates:
16380 * Constant: '<S397>/No Data'
16381 * Switch: '<S397>/Switch6'
16382 * Switch: '<S397>/Switch7'
16383 * Switch: '<S397>/Switch8'
16384 */
16385 if (RTMapsOk) {
16386 /* Gain: '<S397>/m//s_to_km//h' */
16387 L4_MABX_B.ms_to_kmh = L4_MABX_P.ms_to_kmh_Gain *
16388 L4_MABX_B.Decoder_o1.CurrentVelocity;
16389 CurrentVelocity_kph = L4_MABX_B.ms_to_kmh;
16390
16391 /* Gain: '<S397>/for_logging4' */
16392 L4_MABX_B.for_logging4 = L4_MABX_P.for_logging4_Gain *
16393 L4_MABX_B.Decoder_o1.GPS_X;
16394 GPS_X = L4_MABX_B.for_logging4;
16395
16396 /* Gain: '<S397>/for_logging5' */
16397 L4_MABX_B.for_logging5 = L4_MABX_P.for_logging5_Gain *
16398 L4_MABX_B.Decoder_o1.GPS_Y;
16399 GPS_Y = L4_MABX_B.for_logging5;
16400
16401 /* Gain: '<S397>/for_logging6' */
16402 L4_MABX_B.for_logging6 = L4_MABX_P.for_logging6_Gain *
16403 L4_MABX_B.Decoder_o1.GPS_Time;
16404 GPS_Time = L4_MABX_B.for_logging6;
16405 } else {
16406 CurrentVelocity_kph = L4_MABX_P.NoData_Value;
16407 GPS_X = L4_MABX_P.NoData_Value;
16408 GPS_Y = L4_MABX_P.NoData_Value;
16409 GPS_Time = L4_MABX_P.NoData_Value;
16410 }
16411
16412 /* End of Switch: '<S397>/Switch2' */
16413
16414 /* S-Function (rti_commonblock): '<S408>/S-Function1' */
16415
16416 /* This comment workarounds a code generation problem */
16417
16418 /* End of Outputs for S-Function (rti_commonblock): '<S408>/S-Function1' */
16419
16420 /* S-Function (rti_commonblock): '<S414>/S-Function1' */
16421
16422 /* This comment workarounds a code generation problem */
16423
16424 /* End of Outputs for S-Function (rti_commonblock): '<S414>/S-Function1' */
16425
16426 /* S-Function (rti_commonblock): '<S399>/TRC Exclusion' */
16427 /* This comment workarounds a code generation problem */
16428
16429 /* S-Function (rti_commonblock): '<S400>/TRC Exclusion' */
16430 /* This comment workarounds a code generation problem */
16431
16432 /* UnitDelay: '<S3>/Unit_Delay' */
16433 L4_MABX_B.DesSteeringAngle = L4_MABX_DW.Unit_Delay_1_DSTATE;
16434 L4_MABX_B.Stanley_axleAngle2 = L4_MABX_DW.Unit_Delay_10_DSTATE;
16435 L4_MABX_B.DriversDemandEngPercentTorque = L4_MABX_DW.Unit_Delay_100_DSTATE;
16436 L4_MABX_B.SPN514_NominalFrictionPercent_g = L4_MABX_DW.Unit_Delay_101_DSTATE;
16437 L4_MABX_B.SPN2978_EstEngParasiticLosses_m = L4_MABX_DW.Unit_Delay_102_DSTATE;
16438 L4_MABX_B.SPN1760_GrossCombinationVehic_h = L4_MABX_DW.Unit_Delay_103_DSTATE;
16439 L4_MABX_B.ACCDistanceAlertSignal_o = L4_MABX_DW.Unit_Delay_104_DSTATE;
16440 L4_MABX_B.ForwardCollisionWarning_c = L4_MABX_DW.Unit_Delay_105_DSTATE;
16441 L4_MABX_B.SPN544_EngineReferenceTorque_g = L4_MABX_DW.Unit_Delay_106_DSTATE;
16442 L4_MABX_B.ROPEngCtrlActive = L4_MABX_DW.Unit_Delay_107_DSTATE;
16443 L4_MABX_B.ROPBrakeCtrlActive = L4_MABX_DW.Unit_Delay_108_DSTATE;
16444 L4_MABX_B.YCEngCtrlActive = L4_MABX_DW.Unit_Delay_109_DSTATE;
16445 L4_MABX_B.DesSteeringAngleTerm = L4_MABX_DW.Unit_Delay_11_DSTATE;
16446 L4_MABX_B.YCBrakeCtrlActive = L4_MABX_DW.Unit_Delay_110_DSTATE;
16447 L4_MABX_B.SPN1807_SteeringWheelAngle = L4_MABX_DW.Unit_Delay_111_DSTATE;
16448 L4_MABX_B.SPN1808_YawRate = L4_MABX_DW.Unit_Delay_112_DSTATE;
16449 L4_MABX_B.SPN1810_LongitudinalAcceleratio = L4_MABX_DW.Unit_Delay_113_DSTATE;
16450 L4_MABX_B.SteerWheelTurnCounter = L4_MABX_DW.Unit_Delay_114_DSTATE;
16451 L4_MABX_B.SteerWheelAngleSensorType = L4_MABX_DW.Unit_Delay_115_DSTATE;
16452 L4_MABX_B.LateralAcceleration = L4_MABX_DW.Unit_Delay_116_DSTATE;
16453 L4_MABX_B.BarometricPress = L4_MABX_DW.Unit_Delay_117_DSTATE;
16454 L4_MABX_B.AmbientAirTemp = L4_MABX_DW.Unit_Delay_118_DSTATE;
16455 L4_MABX_B.F_Truck1571_VIN_Match = L4_MABX_DW.Unit_Delay_119_DSTATE;
16456 L4_MABX_B.DesSteeringDistTerm = L4_MABX_DW.Unit_Delay_12_DSTATE;
16457 L4_MABX_B.F_Truck166_VIN_Match = L4_MABX_DW.Unit_Delay_120_DSTATE;
16458 L4_MABX_B.PitchAngleExRange_m = L4_MABX_DW.Unit_Delay_121_DSTATE;
16459 L4_MABX_B.PX2_LanePosEstPosition = L4_MABX_DW.Unit_Delay_122_DSTATE;
16460 L4_MABX_B.PX2_LanePosEstAngle = L4_MABX_DW.Unit_Delay_123_DSTATE;
16461 L4_MABX_B.PX2_LanePosEstNumPoints = L4_MABX_DW.Unit_Delay_124_DSTATE;
16462 L4_MABX_B.Latitude__c = L4_MABX_DW.Unit_Delay_125_DSTATE;
16463 L4_MABX_B.Longitude__m = L4_MABX_DW.Unit_Delay_126_DSTATE;
16464 L4_MABX_B.HDOP__o = L4_MABX_DW.Unit_Delay_127_DSTATE;
16465 L4_MABX_B.XPRControlMode_d = L4_MABX_DW.Unit_Delay_128_DSTATE;
16466 L4_MABX_B.XPRErrorState_d = L4_MABX_DW.Unit_Delay_129_DSTATE;
16467 L4_MABX_B.numLanePoints = L4_MABX_DW.Unit_Delay_13_DSTATE;
16468 L4_MABX_B.PressureP1_a = L4_MABX_DW.Unit_Delay_130_DSTATE;
16469 L4_MABX_B.PressureP4_h = L4_MABX_DW.Unit_Delay_131_DSTATE;
16470 L4_MABX_B.PressureP21_b = L4_MABX_DW.Unit_Delay_132_DSTATE;
16471 L4_MABX_B.PressureP22_e = L4_MABX_DW.Unit_Delay_133_DSTATE;
16472 L4_MABX_B.PressureP42_n = L4_MABX_DW.Unit_Delay_134_DSTATE;
16473 L4_MABX_B.ReAX_ActualHandwheelPos_p = L4_MABX_DW.Unit_Delay_135_DSTATE;
16474 L4_MABX_B.ReAX_EchoedSteerWheelPos_p = L4_MABX_DW.Unit_Delay_136_DSTATE;
16475 L4_MABX_B.SystemsOk_a = L4_MABX_DW.Unit_Delay_137_DSTATE;
16476 L4_MABX_B.SupervisorMode_l = L4_MABX_DW.Unit_Delay_138_DSTATE;
16477 L4_MABX_B.CurrentAzimuth_rad_k = L4_MABX_DW.Unit_Delay_139_DSTATE;
16478 L4_MABX_B.rawPositionError = L4_MABX_DW.Unit_Delay_14_DSTATE;
16479 L4_MABX_B.TargetAzimuth_rad_i = L4_MABX_DW.Unit_Delay_140_DSTATE;
16480 L4_MABX_B.CurrentVelocity_kph_k = L4_MABX_DW.Unit_Delay_141_DSTATE;
16481 L4_MABX_B.TargetVelocity_kph_m = L4_MABX_DW.Unit_Delay_142_DSTATE;
16482 L4_MABX_B.Curvature_a = L4_MABX_DW.Unit_Delay_143_DSTATE;
16483 L4_MABX_B.CrosstrackError_n = L4_MABX_DW.Unit_Delay_144_DSTATE;
16484 L4_MABX_B.slewedPosError = L4_MABX_DW.Unit_Delay_15_DSTATE;
16485 L4_MABX_B.previewSteeringAngle = L4_MABX_DW.Unit_Delay_16_DSTATE;
16486 L4_MABX_B.APTC_Pedal_torque_dem_value = L4_MABX_DW.Unit_Delay_17_DSTATE;
16487 L4_MABX_B.APTC_arb_pedal_low_idl_sw = L4_MABX_DW.Unit_Delay_18_DSTATE;
16488 L4_MABX_B.APTC_arb_pedal_position = L4_MABX_DW.Unit_Delay_19_DSTATE;
16489 L4_MABX_B.DesSteeringPID_Dterm = L4_MABX_DW.Unit_Delay_2_DSTATE;
16490 L4_MABX_B.signal1 = L4_MABX_DW.Unit_Delay_20_DSTATE;
16491 L4_MABX_B.PID_output = L4_MABX_DW.Unit_Delay_21_DSTATE;
16492 L4_MABX_B.PID_output_unlim = L4_MABX_DW.Unit_Delay_22_DSTATE;
16493 L4_MABX_B.PID_control_error = L4_MABX_DW.Unit_Delay_23_DSTATE;
16494 L4_MABX_B.PID_p_term = L4_MABX_DW.Unit_Delay_24_DSTATE;
16495 L4_MABX_B.PID_i_term = L4_MABX_DW.Unit_Delay_25_DSTATE;
16496 L4_MABX_B.PID_d_term = L4_MABX_DW.Unit_Delay_26_DSTATE;
16497 L4_MABX_B.PID_hold_i_term_f = L4_MABX_DW.Unit_Delay_27_DSTATE;
16498 L4_MABX_B.ThrottlePID_Y = L4_MABX_DW.Unit_Delay_28_DSTATE;
16499 L4_MABX_B.EngineSpeedTarget_Y = L4_MABX_DW.Unit_Delay_29_DSTATE;
16500 L4_MABX_B.DesSteeringPID_Iterm = L4_MABX_DW.Unit_Delay_3_DSTATE;
16501 L4_MABX_B.F_Ignition_relay_command = L4_MABX_DW.Unit_Delay_30_DSTATE;
16502 L4_MABX_B.F_Inverter_relay_command = L4_MABX_DW.Unit_Delay_31_DSTATE;
16503 L4_MABX_B.F_MABX_relay_command = L4_MABX_DW.Unit_Delay_32_DSTATE;
16504 L4_MABX_B.F_Sensor_relay_command = L4_MABX_DW.Unit_Delay_33_DSTATE;
16505 L4_MABX_B.BrkPedArbBrakeSwitch = L4_MABX_DW.Unit_Delay_34_DSTATE;
16506 L4_MABX_B.Accel_rate_ms2 = L4_MABX_DW.Unit_Delay_35_DSTATE;
16507 L4_MABX_B.BrakingControlActive = L4_MABX_DW.Unit_Delay_36_DSTATE;
16508 L4_MABX_B.F_Hold_brakes_at_zero = L4_MABX_DW.Unit_Delay_37_DSTATE;
16509 L4_MABX_B.BrakingPID_Y = L4_MABX_DW.Unit_Delay_38_DSTATE;
16510 L4_MABX_B.BrakingPID_Y_Direct_Pressure = L4_MABX_DW.Unit_Delay_39_DSTATE;
16511 L4_MABX_B.DesSteeringPID_Pterm = L4_MABX_DW.Unit_Delay_4_DSTATE;
16512 L4_MABX_B.VSPD_TARGET_KPH_APV_h = L4_MABX_DW.Unit_Delay_40_DSTATE;
16513 L4_MABX_B.Vehicle_speed_target = L4_MABX_DW.Unit_Delay_41_DSTATE;
16514 L4_MABX_B.VSPD_HYST_KPH_APV = L4_MABX_DW.Unit_Delay_42_DSTATE;
16515 L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_APV = L4_MABX_DW.Unit_Delay_43_DSTATE;
16516 L4_MABX_B.ACCEL_LIM_MS2_APV = L4_MABX_DW.Unit_Delay_44_DSTATE;
16517 L4_MABX_B.AutonomousOutputEnabled_n = L4_MABX_DW.Unit_Delay_46_DSTATE;
16518 L4_MABX_B.DesSteeringPID_Y = L4_MABX_DW.Unit_Delay_5_DSTATE;
16519 L4_MABX_B.DesSteeringPID_e = L4_MABX_DW.Unit_Delay_6_DSTATE;
16520 L4_MABX_B.DeSteeringPID_Y2 = L4_MABX_DW.Unit_Delay_7_DSTATE;
16521 L4_MABX_B.CurvatureEst = L4_MABX_DW.Unit_Delay_8_DSTATE;
16522 L4_MABX_B.EngagePB_g = L4_MABX_DW.Unit_Delay_82_DSTATE;
16523 L4_MABX_B.PedalPWMPos = L4_MABX_DW.Unit_Delay_85_DSTATE;
16524 L4_MABX_B.IgnitionKeySwitch_voltage_c = L4_MABX_DW.Unit_Delay_86_DSTATE;
16525 L4_MABX_B.BrakeSwitch_a = L4_MABX_DW.Unit_Delay_87_DSTATE;
16526 L4_MABX_B.Park_brake_switch = L4_MABX_DW.Unit_Delay_88_DSTATE;
16527 L4_MABX_B.CruiseCtrlEnableSwitch = L4_MABX_DW.Unit_Delay_89_DSTATE;
16528 L4_MABX_B.Stanley_axleAngle = L4_MABX_DW.Unit_Delay_9_DSTATE;
16529 L4_MABX_B.FrontAxleSpeed = L4_MABX_DW.Unit_Delay_90_DSTATE;
16530 L4_MABX_B.FrontAxleLeftWheelSpeed = L4_MABX_DW.Unit_Delay_91_DSTATE;
16531 L4_MABX_B.FrontAxleRightWheelSpeed = L4_MABX_DW.Unit_Delay_92_DSTATE;
16532 L4_MABX_B.EBSBrakeSwitch = L4_MABX_DW.Unit_Delay_93_DSTATE;
16533 L4_MABX_B.SPN524_TransSelectedGear_m = L4_MABX_DW.Unit_Delay_94_DSTATE;
16534 L4_MABX_B.SPN523_TransCurrentGear_n = L4_MABX_DW.Unit_Delay_95_DSTATE;
16535 L4_MABX_B.SPN526_TransActualGearRatio_f = L4_MABX_DW.Unit_Delay_96_DSTATE;
16536 L4_MABX_B.ActualEngPercentTorque = L4_MABX_DW.Unit_Delay_97_DSTATE;
16537 L4_MABX_B.ActlEngPrcntTrqueHighResolution = L4_MABX_DW.Unit_Delay_98_DSTATE;
16538 L4_MABX_B.EngSpeed = L4_MABX_DW.Unit_Delay_99_DSTATE;
16539
16540 /* DataTypeConversion: '<S526>/Data Type Conversion' */
16541 L4_MABX_B.DataTypeConversion_l3 = L4_MABX_B.DataTypeConversion_c0[0];
16542
16543 /* DataTypeConversion: '<S526>/Data Type Conversion1' */
16544 L4_MABX_B.DataTypeConversion1_jf = L4_MABX_B.DataTypeConversion_c0[1];
16545
16546 /* ArithShift: '<S526>/Shift Arithmetic' */
16547 L4_MABX_B.ShiftArithmetic_d = (uint16_T)(L4_MABX_B.DataTypeConversion1_jf << 8);
16548
16549 /* S-Function (sfix_bitop): '<S553>/Operator' */
16550 L4_MABX_B.Operator_e4 = (uint16_T)(L4_MABX_B.DataTypeConversion_l3 |
16551 L4_MABX_B.ShiftArithmetic_d);
16552
16553 /* DataTypeConversion: '<S553>/DataType' */
16554 L4_MABX_B.DataType_fs = L4_MABX_B.Operator_e4;
16555
16556 /* DataTypeConversion: '<S526>/Data Type Conversion2' */
16557 L4_MABX_B.DataTypeConversion2_p = L4_MABX_B.DataType_fs;
16558
16559 /* Product: '<S526>/Product' incorporates:
16560 * Constant: '<S526>/Constant'
16561 */
16562 L4_MABX_B.SPN188_EngineSpeedAtIdlePoint1 = L4_MABX_B.DataTypeConversion2_p *
16563 L4_MABX_P.Constant_Value_gw;
16564
16565 /* DataTypeConversion: '<S418>/Data Type Conversion' */
16566 L4_MABX_B.DataTypeConversion_b = L4_MABX_B.SPN188_EngineSpeedAtIdlePoint1;
16567
16568 /* DataTypeConversion: '<S533>/Data Type Conversion' */
16569 L4_MABX_B.DataTypeConversion_i = L4_MABX_B.DataTypeConversion_c0[2];
16570
16571 /* Sum: '<S533>/Add' incorporates:
16572 * Constant: '<S533>/Constant'
16573 */
16574 L4_MABX_B.SPN539_EnginePercentTorqueAtIdl = L4_MABX_B.DataTypeConversion_i +
16575 L4_MABX_P.Constant_Value_he;
16576
16577 /* DataTypeConversion: '<S418>/Data Type Conversion1' */
16578 L4_MABX_B.DataTypeConversion1_e = L4_MABX_B.SPN539_EnginePercentTorqueAtIdl;
16579
16580 /* DataTypeConversion: '<S530>/Data Type Conversion' */
16581 L4_MABX_B.DataTypeConversion_a4 = L4_MABX_B.DataTypeConversion_c0[15];
16582
16583 /* DataTypeConversion: '<S530>/Data Type Conversion1' */
16584 L4_MABX_B.DataTypeConversion1_kb = L4_MABX_B.DataTypeConversion_c0[16];
16585
16586 /* ArithShift: '<S530>/Shift Arithmetic' */
16587 L4_MABX_B.ShiftArithmetic_j = (uint16_T)(L4_MABX_B.DataTypeConversion1_kb << 8);
16588
16589 /* S-Function (sfix_bitop): '<S555>/Operator' */
16590 L4_MABX_B.Operator_jq = (uint16_T)(L4_MABX_B.DataTypeConversion_a4 |
16591 L4_MABX_B.ShiftArithmetic_j);
16592
16593 /* DataTypeConversion: '<S555>/DataType' */
16594 L4_MABX_B.DataType_pm = L4_MABX_B.Operator_jq;
16595
16596 /* DataTypeConversion: '<S530>/Data Type Conversion2' */
16597 L4_MABX_B.DataTypeConversion2_o = L4_MABX_B.DataType_pm;
16598
16599 /* Product: '<S530>/Product' incorporates:
16600 * Constant: '<S530>/Constant'
16601 */
16602 L4_MABX_B.SPN532_EngineSpeedAtHighIdlePoi = L4_MABX_B.DataTypeConversion2_o *
16603 L4_MABX_P.Constant_Value_ki;
16604
16605 /* DataTypeConversion: '<S418>/Data Type Conversion10' */
16606 L4_MABX_B.DataTypeConversion10 = L4_MABX_B.SPN532_EngineSpeedAtHighIdlePoi;
16607
16608 /* DataTypeConversion: '<S531>/Data Type Conversion1' */
16609 L4_MABX_B.DataTypeConversion1_fe = L4_MABX_B.DataTypeConversion_c0[17];
16610
16611 /* DataTypeConversion: '<S531>/Data Type Conversion3' */
16612 L4_MABX_B.DataTypeConversion3_a0 = L4_MABX_B.DataTypeConversion_c0[18];
16613
16614 /* ArithShift: '<S531>/Shift Arithmetic' */
16615 L4_MABX_B.ShiftArithmetic_dw = (uint16_T)(L4_MABX_B.DataTypeConversion3_a0 <<
16616 8);
16617
16618 /* S-Function (sfix_bitop): '<S556>/Operator' */
16619 L4_MABX_B.Operator_ic = (uint16_T)(L4_MABX_B.DataTypeConversion1_fe |
16620 L4_MABX_B.ShiftArithmetic_dw);
16621
16622 /* DataTypeConversion: '<S556>/DataType' */
16623 L4_MABX_B.DataType_jd = L4_MABX_B.Operator_ic;
16624
16625 /* DataTypeConversion: '<S531>/Data Type Conversion2' */
16626 L4_MABX_B.DataTypeConversion2_f = L4_MABX_B.DataType_jd;
16627
16628 /* Product: '<S531>/Product' incorporates:
16629 * Constant: '<S531>/Constant'
16630 */
16631 L4_MABX_B.SPN545_EngineGainKpOfTheEndspee = L4_MABX_B.DataTypeConversion2_f *
16632 L4_MABX_P.Constant_Value_cz;
16633
16634 /* DataTypeConversion: '<S418>/Data Type Conversion11' */
16635 L4_MABX_B.DataTypeConversion11 = L4_MABX_B.SPN545_EngineGainKpOfTheEndspee;
16636
16637 /* DataTypeConversion: '<S534>/Data Type Conversion1' */
16638 L4_MABX_B.DataTypeConversion1_gb = L4_MABX_B.DataTypeConversion_c0[21];
16639
16640 /* DataTypeConversion: '<S534>/Data Type Conversion3' */
16641 L4_MABX_B.DataTypeConversion3_k = L4_MABX_B.DataTypeConversion_c0[22];
16642
16643 /* ArithShift: '<S534>/Shift Arithmetic' */
16644 L4_MABX_B.ShiftArithmetic_l = (uint16_T)(L4_MABX_B.DataTypeConversion3_k << 8);
16645
16646 /* S-Function (sfix_bitop): '<S558>/Operator' */
16647 L4_MABX_B.Operator_o = (uint16_T)(L4_MABX_B.DataTypeConversion1_gb |
16648 L4_MABX_B.ShiftArithmetic_l);
16649
16650 /* DataTypeConversion: '<S558>/DataType' */
16651 L4_MABX_B.DataType_k4 = L4_MABX_B.Operator_o;
16652
16653 /* DataTypeConversion: '<S534>/Data Type Conversion2' */
16654 L4_MABX_B.DataTypeConversion2_p5 = L4_MABX_B.DataType_k4;
16655
16656 /* Product: '<S534>/Product' incorporates:
16657 * Constant: '<S534>/Constant'
16658 */
16659 L4_MABX_B.SPN533_EngineMaximumMomentaryOv = L4_MABX_B.DataTypeConversion2_p5 *
16660 L4_MABX_P.Constant_Value_ou;
16661
16662 /* DataTypeConversion: '<S418>/Data Type Conversion13' */
16663 L4_MABX_B.DataTypeConversion13 = L4_MABX_B.SPN533_EngineMaximumMomentaryOv;
16664
16665 /* DataTypeConversion: '<S535>/Data Type Conversion2' */
16666 L4_MABX_B.DataTypeConversion2_ci = L4_MABX_B.DataTypeConversion_c0[23];
16667
16668 /* Product: '<S535>/Product' incorporates:
16669 * Constant: '<S535>/Constant'
16670 */
16671 L4_MABX_B.SPN534_EngineMaximumMomentaryOv = L4_MABX_B.DataTypeConversion2_ci *
16672 L4_MABX_P.Constant_Value_op;
16673
16674 /* DataTypeConversion: '<S418>/Data Type Conversion14' */
16675 L4_MABX_B.DataTypeConversion14 = L4_MABX_B.SPN534_EngineMaximumMomentaryOv;
16676
16677 /* DataTypeConversion: '<S536>/Data Type Conversion2' */
16678 L4_MABX_B.DataTypeConversion2_g = L4_MABX_B.DataTypeConversion_c0[24];
16679
16680 /* Product: '<S536>/Product' incorporates:
16681 * Constant: '<S536>/Constant'
16682 */
16683 L4_MABX_B.SPN535_EngineRequestedSpeedCont = L4_MABX_B.DataTypeConversion2_g *
16684 L4_MABX_P.Constant_Value_bo;
16685
16686 /* DataTypeConversion: '<S418>/Data Type Conversion15' */
16687 L4_MABX_B.DataTypeConversion15 = L4_MABX_B.SPN535_EngineRequestedSpeedCont;
16688
16689 /* DataTypeConversion: '<S537>/Data Type Conversion2' */
16690 L4_MABX_B.DataTypeConversion2_i = L4_MABX_B.DataTypeConversion_c0[25];
16691
16692 /* Product: '<S537>/Product' incorporates:
16693 * Constant: '<S537>/Constant'
16694 */
16695 L4_MABX_B.SPN536_EngineRequestedSpeedCont = L4_MABX_B.DataTypeConversion2_i *
16696 L4_MABX_P.Constant_Value_ag;
16697
16698 /* DataTypeConversion: '<S418>/Data Type Conversion16' */
16699 L4_MABX_B.DataTypeConversion16 = L4_MABX_B.SPN536_EngineRequestedSpeedCont;
16700
16701 /* DataTypeConversion: '<S538>/Data Type Conversion' */
16702 L4_MABX_B.DataTypeConversion_f3 = L4_MABX_B.DataTypeConversion_c0[26];
16703
16704 /* Sum: '<S538>/Add' incorporates:
16705 * Constant: '<S538>/Constant'
16706 */
16707 L4_MABX_B.SPN537_EngineRequestedTorqueCon = L4_MABX_B.DataTypeConversion_f3 +
16708 L4_MABX_P.Constant_Value_at;
16709
16710 /* DataTypeConversion: '<S418>/Data Type Conversion17' */
16711 L4_MABX_B.DataTypeConversion17 = L4_MABX_B.SPN537_EngineRequestedTorqueCon;
16712
16713 /* DataTypeConversion: '<S539>/Data Type Conversion' */
16714 L4_MABX_B.DataTypeConversion_g = L4_MABX_B.DataTypeConversion_c0[27];
16715
16716 /* Sum: '<S539>/Add' incorporates:
16717 * Constant: '<S539>/Constant'
16718 */
16719 L4_MABX_B.SPN538_EngineRequestedTorqueCon = L4_MABX_B.DataTypeConversion_g +
16720 L4_MABX_P.Constant_Value_gz;
16721
16722 /* DataTypeConversion: '<S418>/Data Type Conversion18' */
16723 L4_MABX_B.DataTypeConversion18 = L4_MABX_B.SPN538_EngineRequestedTorqueCon;
16724
16725 /* DataTypeConversion: '<S540>/Data Type Conversion1' */
16726 L4_MABX_B.DataTypeConversion1_ie = L4_MABX_B.DataTypeConversion_c0[28];
16727
16728 /* DataTypeConversion: '<S540>/Data Type Conversion3' */
16729 L4_MABX_B.DataTypeConversion3_o = L4_MABX_B.DataTypeConversion_c0[29];
16730
16731 /* ArithShift: '<S540>/Shift Arithmetic' */
16732 L4_MABX_B.ShiftArithmetic_e = (uint16_T)(L4_MABX_B.DataTypeConversion3_o << 8);
16733
16734 /* S-Function (sfix_bitop): '<S559>/Operator' */
16735 L4_MABX_B.Operator_od = (uint16_T)(L4_MABX_B.DataTypeConversion1_ie |
16736 L4_MABX_B.ShiftArithmetic_e);
16737
16738 /* DataTypeConversion: '<S559>/DataType' */
16739 L4_MABX_B.DataType_gi = L4_MABX_B.Operator_od;
16740
16741 /* DataTypeConversion: '<S540>/Data Type Conversion2' */
16742 L4_MABX_B.DataTypeConversion2_cg = L4_MABX_B.DataType_gi;
16743
16744 /* Product: '<S540>/Product' incorporates:
16745 * Constant: '<S540>/Constant'
16746 */
16747 L4_MABX_B.SPN1712_EngRequestedSpeedCtrlRn = L4_MABX_B.DataTypeConversion2_cg *
16748 L4_MABX_P.Constant_Value_oun;
16749
16750 /* DataTypeConversion: '<S418>/Data Type Conversion19' */
16751 L4_MABX_B.DataTypeConversion19 = L4_MABX_B.SPN1712_EngRequestedSpeedCtrlRn;
16752
16753 /* DataTypeConversion: '<S548>/Data Type Conversion' */
16754 L4_MABX_B.DataTypeConversion_ig = L4_MABX_B.DataTypeConversion_c0[3];
16755
16756 /* DataTypeConversion: '<S548>/Data Type Conversion1' */
16757 L4_MABX_B.DataTypeConversion1_pi = L4_MABX_B.DataTypeConversion_c0[4];
16758
16759 /* ArithShift: '<S548>/Shift Arithmetic' */
16760 L4_MABX_B.ShiftArithmetic_f = (uint16_T)(L4_MABX_B.DataTypeConversion1_pi << 8);
16761
16762 /* S-Function (sfix_bitop): '<S562>/Operator' */
16763 L4_MABX_B.Operator_cd = (uint16_T)(L4_MABX_B.DataTypeConversion_ig |
16764 L4_MABX_B.ShiftArithmetic_f);
16765
16766 /* DataTypeConversion: '<S562>/DataType' */
16767 L4_MABX_B.DataType_im = L4_MABX_B.Operator_cd;
16768
16769 /* DataTypeConversion: '<S548>/Data Type Conversion2' */
16770 L4_MABX_B.DataTypeConversion2_o2 = L4_MABX_B.DataType_im;
16771
16772 /* Product: '<S548>/Product' incorporates:
16773 * Constant: '<S548>/Constant'
16774 */
16775 L4_MABX_B.SPN528_EngineSpeedAtPoint2 = L4_MABX_B.DataTypeConversion2_o2 *
16776 L4_MABX_P.Constant_Value_mf;
16777
16778 /* DataTypeConversion: '<S418>/Data Type Conversion2' */
16779 L4_MABX_B.DataTypeConversion2_g0 = L4_MABX_B.SPN528_EngineSpeedAtPoint2;
16780
16781 /* DataTypeConversion: '<S541>/Data Type Conversion1' */
16782 L4_MABX_B.DataTypeConversion1_g5 = L4_MABX_B.DataTypeConversion_c0[30];
16783
16784 /* DataTypeConversion: '<S541>/Data Type Conversion3' */
16785 L4_MABX_B.DataTypeConversion3_en = L4_MABX_B.DataTypeConversion_c0[31];
16786
16787 /* ArithShift: '<S541>/Shift Arithmetic' */
16788 L4_MABX_B.ShiftArithmetic_k = (uint16_T)(L4_MABX_B.DataTypeConversion3_en << 8);
16789
16790 /* S-Function (sfix_bitop): '<S560>/Operator' */
16791 L4_MABX_B.Operator_gw = (uint16_T)(L4_MABX_B.DataTypeConversion1_g5 |
16792 L4_MABX_B.ShiftArithmetic_k);
16793
16794 /* DataTypeConversion: '<S560>/DataType' */
16795 L4_MABX_B.DataType_b0 = L4_MABX_B.Operator_gw;
16796
16797 /* DataTypeConversion: '<S541>/Data Type Conversion2' */
16798 L4_MABX_B.DataTypeConversion2_b = L4_MABX_B.DataType_b0;
16799
16800 /* Product: '<S541>/Product' incorporates:
16801 * Constant: '<S541>/Constant'
16802 */
16803 L4_MABX_B.SPN1794_EngineMomentOfInertia = L4_MABX_B.DataTypeConversion2_b *
16804 L4_MABX_P.Constant_Value_pm;
16805
16806 /* DataTypeConversion: '<S418>/Data Type Conversion20' */
16807 L4_MABX_B.DataTypeConversion20 = L4_MABX_B.SPN1794_EngineMomentOfInertia;
16808
16809 /* DataTypeConversion: '<S542>/Data Type Conversion' */
16810 L4_MABX_B.DataTypeConversion_h = L4_MABX_B.DataTypeConversion_c0[32];
16811
16812 /* DataTypeConversion: '<S542>/Data Type Conversion1' */
16813 L4_MABX_B.DataTypeConversion1_p5 = L4_MABX_B.DataTypeConversion_c0[33];
16814
16815 /* ArithShift: '<S542>/Shift Arithmetic' */
16816 L4_MABX_B.ShiftArithmetic_g = (uint16_T)(L4_MABX_B.DataTypeConversion1_p5 << 8);
16817
16818 /* S-Function (sfix_bitop): '<S561>/Operator' */
16819 L4_MABX_B.Operator_b = (uint16_T)(L4_MABX_B.DataTypeConversion_h |
16820 L4_MABX_B.ShiftArithmetic_g);
16821
16822 /* DataTypeConversion: '<S561>/DataType' */
16823 L4_MABX_B.DataType_ge = L4_MABX_B.Operator_b;
16824
16825 /* DataTypeConversion: '<S542>/Data Type Conversion2' */
16826 L4_MABX_B.SPN1846_EngineDefaultTorqueLimi = L4_MABX_B.DataType_ge;
16827
16828 /* DataTypeConversion: '<S418>/Data Type Conversion21' */
16829 L4_MABX_B.DataTypeConversion21 = L4_MABX_B.SPN1846_EngineDefaultTorqueLimi;
16830
16831 /* DataTypeConversion: '<S418>/Data Type Conversion22' */
16832 L4_MABX_B.DataTypeConversion22 = L4_MABX_B.DataTypeConversion_c0[34];
16833
16834 /* DataTypeConversion: '<S418>/Data Type Conversion23' */
16835 L4_MABX_B.DataTypeConversion23 = L4_MABX_B.DataTypeConversion_c0[35];
16836
16837 /* DataTypeConversion: '<S418>/Data Type Conversion24' */
16838 L4_MABX_B.DataTypeConversion24 = L4_MABX_B.DataTypeConversion_c0[36];
16839
16840 /* DataTypeConversion: '<S418>/Data Type Conversion25' */
16841 L4_MABX_B.DataTypeConversion25 = L4_MABX_B.DataTypeConversion_c0[37];
16842
16843 /* DataTypeConversion: '<S418>/Data Type Conversion26' */
16844 L4_MABX_B.DataTypeConversion26 = L4_MABX_B.DataTypeConversion_c0[38];
16845
16846 /* DataTypeConversion: '<S549>/Data Type Conversion' */
16847 L4_MABX_B.DataTypeConversion_k = L4_MABX_B.DataTypeConversion_c0[5];
16848
16849 /* Sum: '<S549>/Add' incorporates:
16850 * Constant: '<S549>/Constant'
16851 */
16852 L4_MABX_B.SPN540_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_k +
16853 L4_MABX_P.Constant_Value_d4;
16854
16855 /* DataTypeConversion: '<S418>/Data Type Conversion3' */
16856 L4_MABX_B.DataTypeConversion3 = L4_MABX_B.SPN540_EnginePercentTorqueAtPoi;
16857
16858 /* DataTypeConversion: '<S550>/Data Type Conversion' */
16859 L4_MABX_B.DataTypeConversion_o = L4_MABX_B.DataTypeConversion_c0[6];
16860
16861 /* DataTypeConversion: '<S550>/Data Type Conversion1' */
16862 L4_MABX_B.DataTypeConversion1_cl = L4_MABX_B.DataTypeConversion_c0[7];
16863
16864 /* ArithShift: '<S550>/Shift Arithmetic' */
16865 L4_MABX_B.ShiftArithmetic_n = (uint16_T)(L4_MABX_B.DataTypeConversion1_cl << 8);
16866
16867 /* S-Function (sfix_bitop): '<S563>/Operator' */
16868 L4_MABX_B.Operator_ov = (uint16_T)(L4_MABX_B.DataTypeConversion_o |
16869 L4_MABX_B.ShiftArithmetic_n);
16870
16871 /* DataTypeConversion: '<S563>/DataType' */
16872 L4_MABX_B.DataType_fe = L4_MABX_B.Operator_ov;
16873
16874 /* DataTypeConversion: '<S550>/Data Type Conversion2' */
16875 L4_MABX_B.DataTypeConversion2_gt = L4_MABX_B.DataType_fe;
16876
16877 /* Product: '<S550>/Product' incorporates:
16878 * Constant: '<S550>/Constant'
16879 */
16880 L4_MABX_B.SPN529_EngineSpeedAtPoint3 = L4_MABX_B.DataTypeConversion2_gt *
16881 L4_MABX_P.Constant_Value_fp;
16882
16883 /* DataTypeConversion: '<S418>/Data Type Conversion4' */
16884 L4_MABX_B.DataTypeConversion4 = L4_MABX_B.SPN529_EngineSpeedAtPoint3;
16885
16886 /* DataTypeConversion: '<S551>/Data Type Conversion' */
16887 L4_MABX_B.DataTypeConversion_fa = L4_MABX_B.DataTypeConversion_c0[8];
16888
16889 /* Sum: '<S551>/Add' incorporates:
16890 * Constant: '<S551>/Constant'
16891 */
16892 L4_MABX_B.SPN541_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_fa +
16893 L4_MABX_P.Constant_Value_o3;
16894
16895 /* DataTypeConversion: '<S418>/Data Type Conversion5' */
16896 L4_MABX_B.DataTypeConversion5 = L4_MABX_B.SPN541_EnginePercentTorqueAtPoi;
16897
16898 /* DataTypeConversion: '<S552>/Data Type Conversion' */
16899 L4_MABX_B.DataTypeConversion_kf = L4_MABX_B.DataTypeConversion_c0[9];
16900
16901 /* DataTypeConversion: '<S552>/Data Type Conversion1' */
16902 L4_MABX_B.DataTypeConversion1_go = L4_MABX_B.DataTypeConversion_c0[10];
16903
16904 /* ArithShift: '<S552>/Shift Arithmetic' */
16905 L4_MABX_B.ShiftArithmetic_p = (uint16_T)(L4_MABX_B.DataTypeConversion1_go << 8);
16906
16907 /* S-Function (sfix_bitop): '<S564>/Operator' */
16908 L4_MABX_B.Operator_f = (uint16_T)(L4_MABX_B.DataTypeConversion_kf |
16909 L4_MABX_B.ShiftArithmetic_p);
16910
16911 /* DataTypeConversion: '<S564>/DataType' */
16912 L4_MABX_B.DataType_n4 = L4_MABX_B.Operator_f;
16913
16914 /* DataTypeConversion: '<S552>/Data Type Conversion2' */
16915 L4_MABX_B.DataTypeConversion2_oj = L4_MABX_B.DataType_n4;
16916
16917 /* Product: '<S552>/Product' incorporates:
16918 * Constant: '<S552>/Constant'
16919 */
16920 L4_MABX_B.SPN530_EngineSpeedAtPoint4 = L4_MABX_B.DataTypeConversion2_oj *
16921 L4_MABX_P.Constant_Value_ht;
16922
16923 /* DataTypeConversion: '<S418>/Data Type Conversion6' */
16924 L4_MABX_B.DataTypeConversion6 = L4_MABX_B.SPN530_EngineSpeedAtPoint4;
16925
16926 /* DataTypeConversion: '<S527>/Data Type Conversion' */
16927 L4_MABX_B.DataTypeConversion_p = L4_MABX_B.DataTypeConversion_c0[11];
16928
16929 /* Sum: '<S527>/Add' incorporates:
16930 * Constant: '<S527>/Constant'
16931 */
16932 L4_MABX_B.SPN542_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_p +
16933 L4_MABX_P.Constant_Value_eo;
16934
16935 /* DataTypeConversion: '<S418>/Data Type Conversion7' */
16936 L4_MABX_B.DataTypeConversion7 = L4_MABX_B.SPN542_EnginePercentTorqueAtPoi;
16937
16938 /* DataTypeConversion: '<S528>/Data Type Conversion' */
16939 L4_MABX_B.DataTypeConversion_jv = L4_MABX_B.DataTypeConversion_c0[12];
16940
16941 /* DataTypeConversion: '<S528>/Data Type Conversion1' */
16942 L4_MABX_B.DataTypeConversion1_ci = L4_MABX_B.DataTypeConversion_c0[13];
16943
16944 /* ArithShift: '<S528>/Shift Arithmetic' */
16945 L4_MABX_B.ShiftArithmetic_gq = (uint16_T)(L4_MABX_B.DataTypeConversion1_ci <<
16946 8);
16947
16948 /* S-Function (sfix_bitop): '<S554>/Operator' */
16949 L4_MABX_B.Operator_mq = (uint16_T)(L4_MABX_B.DataTypeConversion_jv |
16950 L4_MABX_B.ShiftArithmetic_gq);
16951
16952 /* DataTypeConversion: '<S554>/DataType' */
16953 L4_MABX_B.DataType_jw = L4_MABX_B.Operator_mq;
16954
16955 /* DataTypeConversion: '<S528>/Data Type Conversion2' */
16956 L4_MABX_B.DataTypeConversion2_n = L4_MABX_B.DataType_jw;
16957
16958 /* Product: '<S528>/Product' incorporates:
16959 * Constant: '<S528>/Constant'
16960 */
16961 L4_MABX_B.SPN531_EngineSpeedAtPoint5 = L4_MABX_B.DataTypeConversion2_n *
16962 L4_MABX_P.Constant_Value_hs;
16963
16964 /* DataTypeConversion: '<S418>/Data Type Conversion8' */
16965 L4_MABX_B.DataTypeConversion8 = L4_MABX_B.SPN531_EngineSpeedAtPoint5;
16966
16967 /* DataTypeConversion: '<S529>/Data Type Conversion' */
16968 L4_MABX_B.DataTypeConversion_j = L4_MABX_B.DataTypeConversion_c0[14];
16969
16970 /* Sum: '<S529>/Add' incorporates:
16971 * Constant: '<S529>/Constant'
16972 */
16973 L4_MABX_B.SPN543_EnginePercentTorqueAtPoi = L4_MABX_B.DataTypeConversion_j +
16974 L4_MABX_P.Constant_Value_fj;
16975
16976 /* DataTypeConversion: '<S418>/Data Type Conversion9' */
16977 L4_MABX_B.DataTypeConversion9 = L4_MABX_B.SPN543_EnginePercentTorqueAtPoi;
16978
16979 /* DataTypeConversion: '<S475>/Data Type Conversion8' */
16980 L4_MABX_B.RX_status_ec = (L4_MABX_B.SFunction1_o9_cg != 0.0);
16981
16982 /* MultiPortSwitch: '<S421>/Multiport_Switch' */
16983 L4_MABX_B.RX_status_el = L4_MABX_B.RX_status_ec;
16984
16985 /* DataTypeConversion: '<S475>/Data Type Conversion9' */
16986 L4_MABX_B.RX_time = L4_MABX_B.SFunction1_o10_mb;
16987
16988 /* MultiPortSwitch: '<S421>/Multiport_Switch' */
16989 L4_MABX_B.RX_time_j = L4_MABX_B.RX_time;
16990
16991 /* DataTypeConversion: '<S475>/Data Type Conversion10' */
16992 L4_MABX_B.RX_delta_time = L4_MABX_B.SFunction1_o11_hc;
16993
16994 /* MultiPortSwitch: '<S421>/Multiport_Switch' */
16995 L4_MABX_B.RX_delta_time_n = L4_MABX_B.RX_delta_time;
16996
16997 /* RelationalOperator: '<S479>/Operator' incorporates:
16998 * Constant: '<S421>/Constant'
16999 * Constant: '<S476>/Constant1'
17000 */
17001 L4_MABX_B.Operator_nj2 = (L4_MABX_P.Constant_Value_bl ==
17002 L4_MABX_P.Constant1_Value_jk);
17003
17004 /* RelationalOperator: '<S480>/Operator' incorporates:
17005 * Constant: '<S421>/Constant'
17006 * Constant: '<S476>/Constant2'
17007 */
17008 L4_MABX_B.Operator_bm = (L4_MABX_P.Constant_Value_bl ==
17009 L4_MABX_P.Constant2_Value_o);
17010
17011 /* RelationalOperator: '<S481>/Operator' incorporates:
17012 * Constant: '<S421>/Constant'
17013 * Constant: '<S476>/Constant3'
17014 */
17015 L4_MABX_B.Operator_dl = (L4_MABX_P.Constant_Value_bl ==
17016 L4_MABX_P.Constant3_Value_d0);
17017
17018 /* RelationalOperator: '<S482>/Operator' incorporates:
17019 * Constant: '<S421>/Constant'
17020 * Constant: '<S476>/Constant4'
17021 */
17022 L4_MABX_B.Operator_hdc = (L4_MABX_P.Constant_Value_bl ==
17023 L4_MABX_P.Constant4_Value_pa);
17024
17025 /* RelationalOperator: '<S483>/Operator' incorporates:
17026 * Constant: '<S421>/Constant'
17027 * Constant: '<S476>/Constant5'
17028 */
17029 L4_MABX_B.Operator_d0 = (L4_MABX_P.Constant_Value_bl ==
17030 L4_MABX_P.Constant5_Value_d);
17031
17032 /* DataTypeConversion: '<S484>/Data Type Conversion9' */
17033 L4_MABX_B.RX_time_jk = L4_MABX_B.SFunction1_o10_eo;
17034
17035 /* MultiPortSwitch: '<S422>/Multiport_Switch' */
17036 L4_MABX_B.RX_time_o = L4_MABX_B.RX_time_jk;
17037
17038 /* DataTypeConversion: '<S484>/Data Type Conversion10' */
17039 L4_MABX_B.RX_delta_time_j = L4_MABX_B.SFunction1_o11_k;
17040
17041 /* MultiPortSwitch: '<S422>/Multiport_Switch' */
17042 L4_MABX_B.RX_delta_time_m = L4_MABX_B.RX_delta_time_j;
17043
17044 /* RelationalOperator: '<S488>/Operator' incorporates:
17045 * Constant: '<S422>/Constant'
17046 * Constant: '<S485>/Constant1'
17047 */
17048 L4_MABX_B.Operator_goa = (L4_MABX_P.Constant_Value_b4 ==
17049 L4_MABX_P.Constant1_Value_gp);
17050
17051 /* RelationalOperator: '<S489>/Operator' incorporates:
17052 * Constant: '<S422>/Constant'
17053 * Constant: '<S485>/Constant2'
17054 */
17055 L4_MABX_B.Operator_el = (L4_MABX_P.Constant_Value_b4 ==
17056 L4_MABX_P.Constant2_Value_g0);
17057
17058 /* RelationalOperator: '<S490>/Operator' incorporates:
17059 * Constant: '<S422>/Constant'
17060 * Constant: '<S485>/Constant3'
17061 */
17062 L4_MABX_B.Operator_jyv = (L4_MABX_P.Constant_Value_b4 ==
17063 L4_MABX_P.Constant3_Value_m);
17064
17065 /* RelationalOperator: '<S491>/Operator' incorporates:
17066 * Constant: '<S422>/Constant'
17067 * Constant: '<S485>/Constant4'
17068 */
17069 L4_MABX_B.Operator_a0 = (L4_MABX_P.Constant_Value_b4 ==
17070 L4_MABX_P.Constant4_Value_js);
17071
17072 /* RelationalOperator: '<S492>/Operator' incorporates:
17073 * Constant: '<S422>/Constant'
17074 * Constant: '<S485>/Constant5'
17075 */
17076 L4_MABX_B.Operator_h3s = (L4_MABX_P.Constant_Value_b4 ==
17077 L4_MABX_P.Constant5_Value_n);
17078
17079 /* DataTypeConversion: '<S493>/Data Type Conversion1' */
17080 L4_MABX_B.SpeedOfForwardVehicle = L4_MABX_B.SFunction1_o1_lz;
17081
17082 /* DataTypeConversion: '<S493>/Data Type Conversion10' */
17083 L4_MABX_B.RX_delta_time_d = L4_MABX_B.SFunction1_o13_i;
17084
17085 /* DataTypeConversion: '<S493>/Data Type Conversion11' */
17086 L4_MABX_B.ACCSystemShutoffWarning = L4_MABX_B.SFunction1_o8_o1;
17087
17088 /* DataTypeConversion: '<S493>/Data Type Conversion2' */
17089 L4_MABX_B.DistanceToForwardVehicle = L4_MABX_B.SFunction1_o2_cq;
17090
17091 /* DataTypeConversion: '<S493>/Data Type Conversion3' */
17092 L4_MABX_B.AdaptiveCruiseCtrlSetSpeed = L4_MABX_B.SFunction1_o3_ew;
17093
17094 /* DataTypeConversion: '<S493>/Data Type Conversion4' */
17095 L4_MABX_B.AdaptiveCruiseCtrlMode = L4_MABX_B.SFunction1_o4_jvw;
17096
17097 /* DataTypeConversion: '<S493>/Data Type Conversion5' */
17098 L4_MABX_B.AdptveCruiseCtrlSetDistanceMode = L4_MABX_B.SFunction1_o5_p3;
17099
17100 /* DataTypeConversion: '<S493>/Data Type Conversion6' */
17101 L4_MABX_B.RoadCurvature = L4_MABX_B.SFunction1_o6_jd;
17102
17103 /* DataTypeConversion: '<S493>/Data Type Conversion7' */
17104 L4_MABX_B.ACCTargetDetected = L4_MABX_B.SFunction1_o7_p;
17105
17106 /* DataTypeConversion: '<S493>/Data Type Conversion8' */
17107 L4_MABX_B.RX_status_a = (L4_MABX_B.SFunction1_o11_e != 0.0);
17108
17109 /* DataTypeConversion: '<S493>/Data Type Conversion9' */
17110 L4_MABX_B.RX_time_m = L4_MABX_B.SFunction1_o12_ag;
17111
17112 /* Outputs for Enabled SubSystem: '<S495>/AEBS1_A0' incorporates:
17113 * EnablePort: '<S496>/Enable'
17114 */
17115 /* Constant: '<S424>/Constant' */
17116 if (L4_MABX_P.Constant_Value_cu) {
17117 /* S-Function (rti_commonblock): '<S496>/S-Function1' */
17118 /* This comment workarounds a code generation problem */
17119
17120 /* dSPACE RTICAN RX Message Block: "AEBS1_A0" Id:217067306 */
17121 {
17122 UInt32 *CAN_Msg;
17123 static dsfloat time_old = 0.0;
17124
17125 /* Read status and timestamp info (previous message) */
17126 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].timestamp !=
17127 time_old) {
17128 /* ... save timestamp info for the calculation of the RX status
17129 during the consecutive sample hit*/
17130 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].
17131 timestamp;
17132
17133 /* ... set the processed flag to one */
17134 L4_MABX_B.SFunction1_o6_oj = 1.0;
17135 L4_MABX_B.SFunction1_o7_fc = (real_T)
17136 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].timestamp;
17137 L4_MABX_B.SFunction1_o8_lf = (real_T)
17138 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].deltatime;
17139 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0xCF02F2A].data;
17140
17141 /* Decode CAN message */
17142 {
17143 {
17144 rtican_Signal_t CAN_Sgn;
17145
17146 /* ...... "AdvEmergencyBrkSysState" (0|4, standard signal, unsigned int, little endian) */
17147 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
17148 CAN_Sgn.UnsignedSgn &= 0x0000000F;
17149 L4_MABX_B.SFunction1_o1_of = ((real_T) CAN_Sgn.UnsignedSgn);
17150
17151 /* ...... "CollisionWarningLevel" (4|4, standard signal, unsigned int, little endian) */
17152 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
17153 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
17154 CAN_Sgn.UnsignedSgn &= 0x0000000F;
17155 L4_MABX_B.SFunction1_o2_l0 = ((real_T) CAN_Sgn.UnsignedSgn);
17156
17157 /* ...... "RelObjctDetForAdvEmergBrakingSys" (8|3, standard signal, unsigned int, little endian) */
17158 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
17159 CAN_Sgn.UnsignedSgn &= 0x00000007;
17160 L4_MABX_B.SFunction1_o3_ok = ((real_T) CAN_Sgn.UnsignedSgn);
17161
17162 /* ...... "BendOffProbabOfRelevantObject" (12|3, standard signal, unsigned int, little endian) */
17163 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
17164 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
17165 CAN_Sgn.UnsignedSgn &= 0x00000007;
17166 L4_MABX_B.SFunction1_o4_ae = ((real_T) CAN_Sgn.UnsignedSgn);
17167
17168 /* ...... "TimeToCollisionWithRelevantObj" (16|8, standard signal, unsigned int, little endian) */
17169 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
17170 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17171 L4_MABX_B.SFunction1_o5_e2 = ((real_T) CAN_Sgn.UnsignedSgn);
17172 }
17173 }
17174 } else {
17175 /* set RX status to 0 because no new message has arrived */
17176 L4_MABX_B.SFunction1_o6_oj = 0.0;
17177 }
17178 }
17179 }
17180
17181 /* End of Constant: '<S424>/Constant' */
17182 /* End of Outputs for SubSystem: '<S495>/AEBS1_A0' */
17183
17184 /* DataTypeConversion: '<S495>/Data Type Conversion10' */
17185 L4_MABX_B.RX_delta_time_l = L4_MABX_B.SFunction1_o8_lf;
17186
17187 /* DataTypeConversion: '<S495>/Data Type Conversion8' */
17188 L4_MABX_B.RX_status_p = (L4_MABX_B.SFunction1_o6_oj != 0.0);
17189
17190 /* DataTypeConversion: '<S495>/Data Type Conversion9' */
17191 L4_MABX_B.RX_time_l = L4_MABX_B.SFunction1_o7_fc;
17192
17193 /* DataTypeConversion: '<S497>/Data Type Conversion10' */
17194 L4_MABX_B.RX_delta_time_b = L4_MABX_B.SFunction1_o11_jy;
17195
17196 /* DataTypeConversion: '<S497>/Data Type Conversion8' */
17197 L4_MABX_B.RX_status_c0 = (L4_MABX_B.SFunction1_o9_n != 0.0);
17198
17199 /* DataTypeConversion: '<S497>/Data Type Conversion9' */
17200 L4_MABX_B.RX_time_i = L4_MABX_B.SFunction1_o10_nt;
17201
17202 /* DataTypeConversion: '<S499>/Data Type Conversion10' */
17203 L4_MABX_B.RX_delta_time_jq = L4_MABX_B.SFunction1_o8_fs;
17204
17205 /* DataTypeConversion: '<S499>/Data Type Conversion8' */
17206 L4_MABX_B.RX_status_n = (L4_MABX_B.SFunction1_o6_e != 0.0);
17207
17208 /* DataTypeConversion: '<S499>/Data Type Conversion9' */
17209 L4_MABX_B.RX_time_f = L4_MABX_B.SFunction1_o7_ie;
17210
17211 /* Outputs for Enabled SubSystem: '<S501>/B2' incorporates:
17212 * EnablePort: '<S502>/Enable'
17213 */
17214 /* Constant: '<S427>/Constant' */
17215 if (L4_MABX_P.Constant_Value_aj > 0.0) {
17216 /* S-Function (rti_commonblock): '<S502>/S-Function1' */
17217 /* This comment workarounds a code generation problem */
17218
17219 /* dSPACE RTICAN RX Message Block: "B2" Id:418451505 */
17220 {
17221 UInt32 *CAN_Msg;
17222 static dsfloat time_old = 0.0;
17223
17224 /* Read status and timestamp info (previous message) */
17225 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].timestamp !=
17226 time_old) {
17227 /* ... save timestamp info for the calculation of the RX status
17228 during the consecutive sample hit*/
17229 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].
17230 timestamp;
17231
17232 /* ... set the processed flag to one */
17233 L4_MABX_B.SFunction1_o3_j5c = 1.0;
17234 L4_MABX_B.SFunction1_o4_fzy = (real_T)
17235 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].timestamp;
17236 L4_MABX_B.SFunction1_o5_j = (real_T)
17237 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].deltatime;
17238 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F11031].data;
17239
17240 /* Decode CAN message */
17241 {
17242 {
17243 rtican_Signal_t CAN_Sgn;
17244
17245 /* ...... "BrakeAppPressDemanded" (0|16, standard signal, unsigned int, little endian) */
17246 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
17247 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
17248 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17249 L4_MABX_B.SFunction1_o1_m2 = 0.1 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
17250
17251 /* ...... "BrakeSwitch2" (16|2, standard signal, unsigned int, little endian) */
17252 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
17253 CAN_Sgn.UnsignedSgn &= 0x00000003;
17254 L4_MABX_B.SFunction1_o2_fs = ((real_T) CAN_Sgn.UnsignedSgn);
17255 }
17256 }
17257 } else {
17258 /* set RX status to 0 because no new message has arrived */
17259 L4_MABX_B.SFunction1_o3_j5c = 0.0;
17260 }
17261 }
17262 }
17263
17264 /* End of Constant: '<S427>/Constant' */
17265 /* End of Outputs for SubSystem: '<S501>/B2' */
17266
17267 /* DataTypeConversion: '<S501>/Data Type Conversion10' */
17268 L4_MABX_B.RX_delta_time_lt = L4_MABX_B.SFunction1_o5_j;
17269
17270 /* DataTypeConversion: '<S501>/Data Type Conversion8' */
17271 L4_MABX_B.RX_status_c05 = (L4_MABX_B.SFunction1_o3_j5c != 0.0);
17272
17273 /* DataTypeConversion: '<S501>/Data Type Conversion9' */
17274 L4_MABX_B.RX_time_c = L4_MABX_B.SFunction1_o4_fzy;
17275
17276 /* Outputs for Enabled SubSystem: '<S503>/Tracks' incorporates:
17277 * EnablePort: '<S504>/Enable'
17278 */
17279 /* Constant: '<S428>/Constant' */
17280 if (L4_MABX_P.Constant_Value_ed) {
17281 /* S-Function (rti_commonblock): '<S504>/S-Function1' */
17282 /* This comment workarounds a code generation problem */
17283
17284 /* dSPACE RTICAN RX Message Block: "Tracks" Id:1635 */
17285 {
17286 UInt32 *CAN_Msg;
17287 static dsfloat time_old = 0.0;
17288
17289 /* Read status and timestamp info (previous message) */
17290 if (can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].timestamp !=
17291 time_old) {
17292 /* ... save timestamp info for the calculation of the RX status
17293 during the consecutive sample hit*/
17294 time_old = can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].timestamp;
17295
17296 /* ... set the processed flag to one */
17297 L4_MABX_B.SFunction1_o72 = 1.0;
17298 L4_MABX_B.SFunction1_o73 = (real_T)
17299 can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].timestamp;
17300 L4_MABX_B.SFunction1_o74 = (real_T)
17301 can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].deltatime;
17302 CAN_Msg = can_type1_M2_C1_STD[CANTP1_M2_C1_RXSRVC_STD_0x663].data;
17303
17304 /* Decode CAN message */
17305 {
17306 {
17307 rtican_Signal_t CAN_Sgn;
17308 UInt32 modeSignal;
17309
17310 /* ...... "track_multiplexor" (56|8, mode signal, unsigned int, motorola back.) */
17311 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
17312 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17313 L4_MABX_B.SFunction1_o71 = ((real_T) CAN_Sgn.UnsignedSgn);
17314 modeSignal = (UInt32) L4_MABX_B.SFunction1_o71;
17315 if (modeSignal == 4) {
17316 /* ...... "tr0_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */
17317 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17318 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17319 CAN_Sgn.UnsignedSgn &= 0x00001FFF;
17320 L4_MABX_B.SFunction1_o1_cy = ((real_T) CAN_Sgn.UnsignedSgn);
17321 }
17322
17323 if (modeSignal == 5) {
17324 /* ...... "tr0_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */
17325 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17326 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17327 CAN_Sgn.SignedSgn &= 0x0000FFFF;
17328 if (CAN_Sgn.SignedSgn >> 15) {
17329 CAN_Sgn.SignedSgn |= 0xFFFF0000;
17330 }
17331
17332 L4_MABX_B.SFunction1_o2_dt = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn)
17333 );
17334 }
17335
17336 if (modeSignal == 12) {
17337 /* ...... "tr1_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */
17338 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17339 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17340 CAN_Sgn.UnsignedSgn &= 0x00001FFF;
17341 L4_MABX_B.SFunction1_o3_lj = ((real_T) CAN_Sgn.UnsignedSgn);
17342 }
17343
17344 if (modeSignal == 13) {
17345 /* ...... "tr1_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */
17346 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17347 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17348 CAN_Sgn.SignedSgn &= 0x0000FFFF;
17349 if (CAN_Sgn.SignedSgn >> 15) {
17350 CAN_Sgn.SignedSgn |= 0xFFFF0000;
17351 }
17352
17353 L4_MABX_B.SFunction1_o4_aa = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn)
17354 );
17355 }
17356
17357 if (modeSignal == 20) {
17358 /* ...... "tr2_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */
17359 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17360 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17361 CAN_Sgn.UnsignedSgn &= 0x00001FFF;
17362 L4_MABX_B.SFunction1_o5_bi = ((real_T) CAN_Sgn.UnsignedSgn);
17363 }
17364
17365 if (modeSignal == 21) {
17366 /* ...... "tr2_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */
17367 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17368 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17369 CAN_Sgn.SignedSgn &= 0x0000FFFF;
17370 if (CAN_Sgn.SignedSgn >> 15) {
17371 CAN_Sgn.SignedSgn |= 0xFFFF0000;
17372 }
17373
17374 L4_MABX_B.SFunction1_o6_ny = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn)
17375 );
17376 }
17377
17378 if (modeSignal == 28) {
17379 /* ...... "tr3_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */
17380 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17381 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17382 CAN_Sgn.UnsignedSgn &= 0x00001FFF;
17383 L4_MABX_B.SFunction1_o7_nm = ((real_T) CAN_Sgn.UnsignedSgn);
17384 }
17385
17386 if (modeSignal == 29) {
17387 /* ...... "tr3_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */
17388 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17389 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17390 CAN_Sgn.SignedSgn &= 0x0000FFFF;
17391 if (CAN_Sgn.SignedSgn >> 15) {
17392 CAN_Sgn.SignedSgn |= 0xFFFF0000;
17393 }
17394
17395 L4_MABX_B.SFunction1_o8_pi = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn)
17396 );
17397 }
17398
17399 if (modeSignal == 36) {
17400 /* ...... "tr4_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */
17401 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17402 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17403 CAN_Sgn.UnsignedSgn &= 0x00001FFF;
17404 L4_MABX_B.SFunction1_o9_c2 = ((real_T) CAN_Sgn.UnsignedSgn);
17405 }
17406
17407 if (modeSignal == 37) {
17408 /* ...... "tr4_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */
17409 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17410 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17411 CAN_Sgn.SignedSgn &= 0x0000FFFF;
17412 if (CAN_Sgn.SignedSgn >> 15) {
17413 CAN_Sgn.SignedSgn |= 0xFFFF0000;
17414 }
17415
17416 L4_MABX_B.SFunction1_o10_b = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn)
17417 );
17418 }
17419
17420 if (modeSignal == 44) {
17421 /* ...... "tr5_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */
17422 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17423 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17424 CAN_Sgn.UnsignedSgn &= 0x00001FFF;
17425 L4_MABX_B.SFunction1_o11_h2 = ((real_T) CAN_Sgn.UnsignedSgn);
17426 }
17427
17428 if (modeSignal == 45) {
17429 /* ...... "tr5_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */
17430 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17431 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17432 CAN_Sgn.SignedSgn &= 0x0000FFFF;
17433 if (CAN_Sgn.SignedSgn >> 15) {
17434 CAN_Sgn.SignedSgn |= 0xFFFF0000;
17435 }
17436
17437 L4_MABX_B.SFunction1_o12_dj = 0.001 * ( ((real_T)
17438 CAN_Sgn.SignedSgn) );
17439 }
17440
17441 if (modeSignal == 52) {
17442 /* ...... "tr6_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */
17443 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17444 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17445 CAN_Sgn.UnsignedSgn &= 0x00001FFF;
17446 L4_MABX_B.SFunction1_o13_n = ((real_T) CAN_Sgn.UnsignedSgn);
17447 }
17448
17449 if (modeSignal == 53) {
17450 /* ...... "tr6_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */
17451 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17452 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17453 CAN_Sgn.SignedSgn &= 0x0000FFFF;
17454 if (CAN_Sgn.SignedSgn >> 15) {
17455 CAN_Sgn.SignedSgn |= 0xFFFF0000;
17456 }
17457
17458 L4_MABX_B.SFunction1_o14_ed = 0.001 * ( ((real_T)
17459 CAN_Sgn.SignedSgn) );
17460 }
17461
17462 if (modeSignal == 60) {
17463 /* ...... "tr7_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */
17464 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17465 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17466 CAN_Sgn.UnsignedSgn &= 0x00001FFF;
17467 L4_MABX_B.SFunction1_o15_e2 = ((real_T) CAN_Sgn.UnsignedSgn);
17468 }
17469
17470 if (modeSignal == 61) {
17471 /* ...... "tr7_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */
17472 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17473 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17474 CAN_Sgn.SignedSgn &= 0x0000FFFF;
17475 if (CAN_Sgn.SignedSgn >> 15) {
17476 CAN_Sgn.SignedSgn |= 0xFFFF0000;
17477 }
17478
17479 L4_MABX_B.SFunction1_o16_i = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn)
17480 );
17481 }
17482
17483 if (modeSignal == 68) {
17484 /* ...... "tr8_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */
17485 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17486 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17487 CAN_Sgn.UnsignedSgn &= 0x00001FFF;
17488 L4_MABX_B.SFunction1_o17_o = ((real_T) CAN_Sgn.UnsignedSgn);
17489 }
17490
17491 if (modeSignal == 69) {
17492 /* ...... "tr8_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */
17493 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17494 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17495 CAN_Sgn.SignedSgn &= 0x0000FFFF;
17496 if (CAN_Sgn.SignedSgn >> 15) {
17497 CAN_Sgn.SignedSgn |= 0xFFFF0000;
17498 }
17499
17500 L4_MABX_B.SFunction1_o18_p = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn)
17501 );
17502 }
17503
17504 if (modeSignal == 76) {
17505 /* ...... "tr9_track_selection_status" (0|13, mode-dependent signal, unsigned int, motorola back.) */
17506 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17507 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17508 CAN_Sgn.UnsignedSgn &= 0x00001FFF;
17509 L4_MABX_B.SFunction1_o19_o = ((real_T) CAN_Sgn.UnsignedSgn);
17510 }
17511
17512 if (modeSignal == 77) {
17513 /* ...... "tr9_corrected_lateral_distance" (0|16, mode-dependent signal, signed int, motorola back.) */
17514 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
17515 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[6];
17516 CAN_Sgn.SignedSgn &= 0x0000FFFF;
17517 if (CAN_Sgn.SignedSgn >> 15) {
17518 CAN_Sgn.SignedSgn |= 0xFFFF0000;
17519 }
17520
17521 L4_MABX_B.SFunction1_o20_i = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn)
17522 );
17523 }
17524
17525 if (modeSignal == 6) {
17526 /* ...... "tr0_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */
17527 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
17528 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
17529 CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6;
17530 CAN_Sgn.SignedSgn &= 0x000003FF;
17531 if (CAN_Sgn.SignedSgn >> 9) {
17532 CAN_Sgn.SignedSgn |= 0xFFFFFC00;
17533 }
17534
17535 L4_MABX_B.SFunction1_o21_b = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
17536 }
17537
17538 if (modeSignal == 14) {
17539 /* ...... "tr1_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */
17540 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
17541 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
17542 CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6;
17543 CAN_Sgn.SignedSgn &= 0x000003FF;
17544 if (CAN_Sgn.SignedSgn >> 9) {
17545 CAN_Sgn.SignedSgn |= 0xFFFFFC00;
17546 }
17547
17548 L4_MABX_B.SFunction1_o22_i = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
17549 }
17550
17551 if (modeSignal == 22) {
17552 /* ...... "tr2_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */
17553 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
17554 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
17555 CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6;
17556 CAN_Sgn.SignedSgn &= 0x000003FF;
17557 if (CAN_Sgn.SignedSgn >> 9) {
17558 CAN_Sgn.SignedSgn |= 0xFFFFFC00;
17559 }
17560
17561 L4_MABX_B.SFunction1_o23_j = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
17562 }
17563
17564 if (modeSignal == 30) {
17565 /* ...... "tr3_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */
17566 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
17567 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
17568 CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6;
17569 CAN_Sgn.SignedSgn &= 0x000003FF;
17570 if (CAN_Sgn.SignedSgn >> 9) {
17571 CAN_Sgn.SignedSgn |= 0xFFFFFC00;
17572 }
17573
17574 L4_MABX_B.SFunction1_o24_j = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
17575 }
17576
17577 if (modeSignal == 38) {
17578 /* ...... "tr4_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */
17579 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
17580 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
17581 CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6;
17582 CAN_Sgn.SignedSgn &= 0x000003FF;
17583 if (CAN_Sgn.SignedSgn >> 9) {
17584 CAN_Sgn.SignedSgn |= 0xFFFFFC00;
17585 }
17586
17587 L4_MABX_B.SFunction1_o25_e = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
17588 }
17589
17590 if (modeSignal == 46) {
17591 /* ...... "tr5_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */
17592 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
17593 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
17594 CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6;
17595 CAN_Sgn.SignedSgn &= 0x000003FF;
17596 if (CAN_Sgn.SignedSgn >> 9) {
17597 CAN_Sgn.SignedSgn |= 0xFFFFFC00;
17598 }
17599
17600 L4_MABX_B.SFunction1_o26_c = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
17601 }
17602
17603 if (modeSignal == 54) {
17604 /* ...... "tr6_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */
17605 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
17606 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
17607 CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6;
17608 CAN_Sgn.SignedSgn &= 0x000003FF;
17609 if (CAN_Sgn.SignedSgn >> 9) {
17610 CAN_Sgn.SignedSgn |= 0xFFFFFC00;
17611 }
17612
17613 L4_MABX_B.SFunction1_o27_e = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
17614 }
17615
17616 if (modeSignal == 62) {
17617 /* ...... "tr7_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */
17618 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
17619 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
17620 CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6;
17621 CAN_Sgn.SignedSgn &= 0x000003FF;
17622 if (CAN_Sgn.SignedSgn >> 9) {
17623 CAN_Sgn.SignedSgn |= 0xFFFFFC00;
17624 }
17625
17626 L4_MABX_B.SFunction1_o28_n = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
17627 }
17628
17629 if (modeSignal == 70) {
17630 /* ...... "tr8_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */
17631 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
17632 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
17633 CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6;
17634 CAN_Sgn.SignedSgn &= 0x000003FF;
17635 if (CAN_Sgn.SignedSgn >> 9) {
17636 CAN_Sgn.SignedSgn |= 0xFFFFFC00;
17637 }
17638
17639 L4_MABX_B.SFunction1_o29 = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
17640 }
17641
17642 if (modeSignal == 78) {
17643 /* ...... "tr9_lateral_position" (14|10, mode-dependent signal, signed int, motorola back.) */
17644 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
17645 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
17646 CAN_Sgn.SignedSgn = ((UInt32)CAN_Sgn.SignedSgn) >> 6;
17647 CAN_Sgn.SignedSgn &= 0x000003FF;
17648 if (CAN_Sgn.SignedSgn >> 9) {
17649 CAN_Sgn.SignedSgn |= 0xFFFFFC00;
17650 }
17651
17652 L4_MABX_B.SFunction1_o30 = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
17653 }
17654
17655 if (modeSignal == 4) {
17656 /* ...... "tr0_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */
17657 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
17658 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
17659 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17660 L4_MABX_B.SFunction1_o31 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
17661 );
17662 }
17663
17664 if (modeSignal == 12) {
17665 /* ...... "tr1_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */
17666 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
17667 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
17668 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17669 L4_MABX_B.SFunction1_o32 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
17670 );
17671 }
17672
17673 if (modeSignal == 20) {
17674 /* ...... "tr2_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */
17675 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
17676 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
17677 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17678 L4_MABX_B.SFunction1_o33 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
17679 );
17680 }
17681
17682 if (modeSignal == 28) {
17683 /* ...... "tr3_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */
17684 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
17685 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
17686 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17687 L4_MABX_B.SFunction1_o34 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
17688 );
17689 }
17690
17691 if (modeSignal == 36) {
17692 /* ...... "tr4_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */
17693 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
17694 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
17695 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17696 L4_MABX_B.SFunction1_o35 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
17697 );
17698 }
17699
17700 if (modeSignal == 44) {
17701 /* ...... "tr5_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */
17702 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
17703 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
17704 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17705 L4_MABX_B.SFunction1_o36 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
17706 );
17707 }
17708
17709 if (modeSignal == 52) {
17710 /* ...... "tr6_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */
17711 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
17712 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
17713 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17714 L4_MABX_B.SFunction1_o37 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
17715 );
17716 }
17717
17718 if (modeSignal == 60) {
17719 /* ...... "tr7_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */
17720 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
17721 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
17722 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17723 L4_MABX_B.SFunction1_o38 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
17724 );
17725 }
17726
17727 if (modeSignal == 68) {
17728 /* ...... "tr8_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */
17729 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
17730 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
17731 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17732 L4_MABX_B.SFunction1_o39 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
17733 );
17734 }
17735
17736 if (modeSignal == 76) {
17737 /* ...... "tr9_range" (16|16, mode-dependent signal, unsigned int, motorola back.) */
17738 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
17739 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
17740 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
17741 L4_MABX_B.SFunction1_o40 = 0.01 * ( ((real_T) CAN_Sgn.UnsignedSgn)
17742 );
17743 }
17744
17745 if (modeSignal == 6) {
17746 /* ...... "tr0_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */
17747 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
17748 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17749 L4_MABX_B.SFunction1_o41 = 0.00392156862745098 * ( ((real_T)
17750 CAN_Sgn.UnsignedSgn) );
17751 }
17752
17753 if (modeSignal == 14) {
17754 /* ...... "tr1_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */
17755 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
17756 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17757 L4_MABX_B.SFunction1_o42 = 0.00392156862745098 * ( ((real_T)
17758 CAN_Sgn.UnsignedSgn) );
17759 }
17760
17761 if (modeSignal == 22) {
17762 /* ...... "tr2_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */
17763 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
17764 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17765 L4_MABX_B.SFunction1_o43 = 0.00392156862745098 * ( ((real_T)
17766 CAN_Sgn.UnsignedSgn) );
17767 }
17768
17769 if (modeSignal == 30) {
17770 /* ...... "tr3_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */
17771 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
17772 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17773 L4_MABX_B.SFunction1_o44 = 0.00392156862745098 * ( ((real_T)
17774 CAN_Sgn.UnsignedSgn) );
17775 }
17776
17777 if (modeSignal == 38) {
17778 /* ...... "tr4_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */
17779 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
17780 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17781 L4_MABX_B.SFunction1_o45 = 0.00392156862745098 * ( ((real_T)
17782 CAN_Sgn.UnsignedSgn) );
17783 }
17784
17785 if (modeSignal == 46) {
17786 /* ...... "tr5_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */
17787 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
17788 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17789 L4_MABX_B.SFunction1_o46 = 0.00392156862745098 * ( ((real_T)
17790 CAN_Sgn.UnsignedSgn) );
17791 }
17792
17793 if (modeSignal == 54) {
17794 /* ...... "tr6_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */
17795 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
17796 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17797 L4_MABX_B.SFunction1_o47 = 0.00392156862745098 * ( ((real_T)
17798 CAN_Sgn.UnsignedSgn) );
17799 }
17800
17801 if (modeSignal == 62) {
17802 /* ...... "tr7_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */
17803 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
17804 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17805 L4_MABX_B.SFunction1_o48 = 0.00392156862745098 * ( ((real_T)
17806 CAN_Sgn.UnsignedSgn) );
17807 }
17808
17809 if (modeSignal == 70) {
17810 /* ...... "tr8_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */
17811 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
17812 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17813 L4_MABX_B.SFunction1_o49 = 0.00392156862745098 * ( ((real_T)
17814 CAN_Sgn.UnsignedSgn) );
17815 }
17816
17817 if (modeSignal == 78) {
17818 /* ...... "tr9_radar_confidence" (24|8, mode-dependent signal, unsigned int, motorola back.) */
17819 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
17820 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17821 L4_MABX_B.SFunction1_o50 = 0.00392156862745098 * ( ((real_T)
17822 CAN_Sgn.UnsignedSgn) );
17823 }
17824
17825 if (modeSignal == 4) {
17826 /* ...... "tr0_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */
17827 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17828 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
17829 CAN_Sgn.SignedSgn &= 0x00003FFF;
17830 if (CAN_Sgn.SignedSgn >> 13) {
17831 CAN_Sgn.SignedSgn |= 0xFFFFC000;
17832 }
17833
17834 L4_MABX_B.SFunction1_o51 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
17835 }
17836
17837 if (modeSignal == 5) {
17838 /* ...... "tr0_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */
17839 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17840 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17841 L4_MABX_B.SFunction1_o52 = -8.8 + ( 0.05 * ( ((real_T)
17842 CAN_Sgn.UnsignedSgn) ) );
17843 }
17844
17845 if (modeSignal == 12) {
17846 /* ...... "tr1_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */
17847 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17848 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
17849 CAN_Sgn.SignedSgn &= 0x00003FFF;
17850 if (CAN_Sgn.SignedSgn >> 13) {
17851 CAN_Sgn.SignedSgn |= 0xFFFFC000;
17852 }
17853
17854 L4_MABX_B.SFunction1_o53 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
17855 }
17856
17857 if (modeSignal == 13) {
17858 /* ...... "tr1_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */
17859 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17860 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17861 L4_MABX_B.SFunction1_o54 = -8.8 + ( 0.05 * ( ((real_T)
17862 CAN_Sgn.UnsignedSgn) ) );
17863 }
17864
17865 if (modeSignal == 20) {
17866 /* ...... "tr2_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */
17867 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17868 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
17869 CAN_Sgn.SignedSgn &= 0x00003FFF;
17870 if (CAN_Sgn.SignedSgn >> 13) {
17871 CAN_Sgn.SignedSgn |= 0xFFFFC000;
17872 }
17873
17874 L4_MABX_B.SFunction1_o55 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
17875 }
17876
17877 if (modeSignal == 21) {
17878 /* ...... "tr2_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */
17879 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17880 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17881 L4_MABX_B.SFunction1_o56 = -8.8 + ( 0.05 * ( ((real_T)
17882 CAN_Sgn.UnsignedSgn) ) );
17883 }
17884
17885 if (modeSignal == 28) {
17886 /* ...... "tr3_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */
17887 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17888 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
17889 CAN_Sgn.SignedSgn &= 0x00003FFF;
17890 if (CAN_Sgn.SignedSgn >> 13) {
17891 CAN_Sgn.SignedSgn |= 0xFFFFC000;
17892 }
17893
17894 L4_MABX_B.SFunction1_o57 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
17895 }
17896
17897 if (modeSignal == 29) {
17898 /* ...... "tr3_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */
17899 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17900 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17901 L4_MABX_B.SFunction1_o58 = -8.8 + ( 0.05 * ( ((real_T)
17902 CAN_Sgn.UnsignedSgn) ) );
17903 }
17904
17905 if (modeSignal == 36) {
17906 /* ...... "tr4_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */
17907 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17908 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
17909 CAN_Sgn.SignedSgn &= 0x00003FFF;
17910 if (CAN_Sgn.SignedSgn >> 13) {
17911 CAN_Sgn.SignedSgn |= 0xFFFFC000;
17912 }
17913
17914 L4_MABX_B.SFunction1_o59 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
17915 }
17916
17917 if (modeSignal == 37) {
17918 /* ...... "tr4_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */
17919 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17920 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17921 L4_MABX_B.SFunction1_o60 = -8.8 + ( 0.05 * ( ((real_T)
17922 CAN_Sgn.UnsignedSgn) ) );
17923 }
17924
17925 if (modeSignal == 44) {
17926 /* ...... "tr5_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */
17927 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17928 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
17929 CAN_Sgn.SignedSgn &= 0x00003FFF;
17930 if (CAN_Sgn.SignedSgn >> 13) {
17931 CAN_Sgn.SignedSgn |= 0xFFFFC000;
17932 }
17933
17934 L4_MABX_B.SFunction1_o61 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
17935 }
17936
17937 if (modeSignal == 45) {
17938 /* ...... "tr5_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */
17939 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17940 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17941 L4_MABX_B.SFunction1_o62 = -8.8 + ( 0.05 * ( ((real_T)
17942 CAN_Sgn.UnsignedSgn) ) );
17943 }
17944
17945 if (modeSignal == 52) {
17946 /* ...... "tr6_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */
17947 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17948 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
17949 CAN_Sgn.SignedSgn &= 0x00003FFF;
17950 if (CAN_Sgn.SignedSgn >> 13) {
17951 CAN_Sgn.SignedSgn |= 0xFFFFC000;
17952 }
17953
17954 L4_MABX_B.SFunction1_o63 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
17955 }
17956
17957 if (modeSignal == 53) {
17958 /* ...... "tr6_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */
17959 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17960 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17961 L4_MABX_B.SFunction1_o64 = -8.8 + ( 0.05 * ( ((real_T)
17962 CAN_Sgn.UnsignedSgn) ) );
17963 }
17964
17965 if (modeSignal == 60) {
17966 /* ...... "tr7_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */
17967 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17968 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
17969 CAN_Sgn.SignedSgn &= 0x00003FFF;
17970 if (CAN_Sgn.SignedSgn >> 13) {
17971 CAN_Sgn.SignedSgn |= 0xFFFFC000;
17972 }
17973
17974 L4_MABX_B.SFunction1_o65 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
17975 }
17976
17977 if (modeSignal == 61) {
17978 /* ...... "tr7_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */
17979 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17980 CAN_Sgn.UnsignedSgn &= 0x000000FF;
17981 L4_MABX_B.SFunction1_o66 = -8.8 + ( 0.05 * ( ((real_T)
17982 CAN_Sgn.UnsignedSgn) ) );
17983 }
17984
17985 if (modeSignal == 68) {
17986 /* ...... "tr8_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */
17987 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
17988 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
17989 CAN_Sgn.SignedSgn &= 0x00003FFF;
17990 if (CAN_Sgn.SignedSgn >> 13) {
17991 CAN_Sgn.SignedSgn |= 0xFFFFC000;
17992 }
17993
17994 L4_MABX_B.SFunction1_o67 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
17995 }
17996
17997 if (modeSignal == 69) {
17998 /* ...... "tr8_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */
17999 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
18000 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18001 L4_MABX_B.SFunction1_o68 = -8.8 + ( 0.05 * ( ((real_T)
18002 CAN_Sgn.UnsignedSgn) ) );
18003 }
18004
18005 if (modeSignal == 76) {
18006 /* ...... "tr9_relative_velocitiy" (32|14, mode-dependent signal, signed int, motorola back.) */
18007 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
18008 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[2];
18009 CAN_Sgn.SignedSgn &= 0x00003FFF;
18010 if (CAN_Sgn.SignedSgn >> 13) {
18011 CAN_Sgn.SignedSgn |= 0xFFFFC000;
18012 }
18013
18014 L4_MABX_B.SFunction1_o69 = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
18015 }
18016
18017 if (modeSignal == 77) {
18018 /* ...... "tr9_acceleration_over_ground" (32|8, mode-dependent signal, unsigned int, motorola back.) */
18019 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
18020 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18021 L4_MABX_B.SFunction1_o70 = -8.8 + ( 0.05 * ( ((real_T)
18022 CAN_Sgn.UnsignedSgn) ) );
18023 }
18024 }
18025 }
18026 } else {
18027 /* set RX status to 0 because no new message has arrived */
18028 L4_MABX_B.SFunction1_o72 = 0.0;
18029 }
18030 }
18031 }
18032
18033 /* End of Constant: '<S428>/Constant' */
18034 /* End of Outputs for SubSystem: '<S503>/Tracks' */
18035
18036 /* DataTypeConversion: '<S503>/Data Type Conversion10' */
18037 L4_MABX_B.Bendix_RADAR_Tracks_RX_delta_ti = L4_MABX_B.SFunction1_o74;
18038
18039 /* DataTypeConversion: '<S503>/Data Type Conversion8' */
18040 L4_MABX_B.Bendix_RADAR_Tracks_RX_status = (L4_MABX_B.SFunction1_o72 != 0.0);
18041
18042 /* DataTypeConversion: '<S503>/Data Type Conversion9' */
18043 L4_MABX_B.Bendix_RADAR_Tracks_RX_time = L4_MABX_B.SFunction1_o73;
18044
18045 /* DataTypeConversion: '<S505>/Data Type Conversion10' */
18046 L4_MABX_B.RX_delta_time_a = L4_MABX_B.SFunction1_o23_a;
18047
18048 /* DataTypeConversion: '<S505>/Data Type Conversion8' */
18049 L4_MABX_B.RX_status_h = (L4_MABX_B.SFunction1_o21_c != 0.0);
18050
18051 /* DataTypeConversion: '<S505>/Data Type Conversion9' */
18052 L4_MABX_B.RX_time_iw = L4_MABX_B.SFunction1_o22_og;
18053
18054 /* DataTypeConversion: '<S507>/Data Type Conversion10' */
18055 L4_MABX_B.RX_delta_time_di = L4_MABX_B.SFunction1_o23_n;
18056
18057 /* DataTypeConversion: '<S507>/Data Type Conversion8' */
18058 L4_MABX_B.RX_status_f = (L4_MABX_B.SFunction1_o21_j != 0.0);
18059
18060 /* DataTypeConversion: '<S507>/Data Type Conversion9' */
18061 L4_MABX_B.RX_time_b = L4_MABX_B.SFunction1_o22_a;
18062
18063 /* Switch: '<S509>/Switch' */
18064 if (L4_MABX_B.RX_status_es) {
18065 L4_MABX_B.RX_status_ao = L4_MABX_B.RX_status_es;
18066 } else {
18067 /* DataTypeConversion: '<S509>/Data Type Conversion1' */
18068 L4_MABX_B.RX_status_fe = (L4_MABX_B.SFunction1_o5_lq != 0.0);
18069 L4_MABX_B.RX_status_ao = L4_MABX_B.RX_status_fe;
18070 }
18071
18072 if (L4_MABX_B.RX_status_es) {
18073 /* DataTypeConversion: '<S509>/Data Type Conversion9' */
18074 L4_MABX_B.RX_time_ed = L4_MABX_B.SFunction1_o6_hp;
18075 L4_MABX_B.RX_time_cn = L4_MABX_B.RX_time_ed;
18076
18077 /* DataTypeConversion: '<S509>/Data Type Conversion10' */
18078 L4_MABX_B.RX_delta_time_nr = L4_MABX_B.SFunction1_o7_ol;
18079 L4_MABX_B.RX_delta_time_ng = L4_MABX_B.RX_delta_time_nr;
18080 } else {
18081 /* DataTypeConversion: '<S509>/Data Type Conversion2' */
18082 L4_MABX_B.RX_time_md = L4_MABX_B.SFunction1_o6_fk;
18083 L4_MABX_B.RX_time_cn = L4_MABX_B.RX_time_md;
18084
18085 /* DataTypeConversion: '<S509>/Data Type Conversion3' */
18086 L4_MABX_B.RX_delta_time_f2 = L4_MABX_B.SFunction1_o7_i;
18087 L4_MABX_B.RX_delta_time_ng = L4_MABX_B.RX_delta_time_f2;
18088 }
18089
18090 /* DataTypeConversion: '<S512>/Data Type Conversion10' */
18091 L4_MABX_B.RX_delta_time_jo = L4_MABX_B.SFunction1_o4_ii;
18092
18093 /* DataTypeConversion: '<S512>/Data Type Conversion8' */
18094 L4_MABX_B.RX_status_o = (L4_MABX_B.SFunction1_o2_ap != 0.0);
18095
18096 /* DataTypeConversion: '<S512>/Data Type Conversion9' */
18097 L4_MABX_B.RX_time_k = L4_MABX_B.SFunction1_o3_dd;
18098
18099 /* Outputs for Enabled SubSystem: '<S514>/EBC1_0B' incorporates:
18100 * EnablePort: '<S515>/Enable'
18101 */
18102 /* Constant: '<S433>/Constant1' */
18103 if (L4_MABX_P.Constant1_Value_n1) {
18104 /* S-Function (rti_commonblock): '<S515>/S-Function1' */
18105 /* This comment workarounds a code generation problem */
18106
18107 /* dSPACE RTICAN RX Message Block: "EBC1_0B" Id:418382091 */
18108 {
18109 UInt32 *CAN_Msg;
18110 static dsfloat time_old = 0.0;
18111
18112 /* Read status and timestamp info (previous message) */
18113 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].timestamp !=
18114 time_old) {
18115 /* ... save timestamp info for the calculation of the RX status
18116 during the consecutive sample hit*/
18117 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].
18118 timestamp;
18119
18120 /* ... set the processed flag to one */
18121 L4_MABX_B.SFunction1_o23_k = 1.0;
18122 L4_MABX_B.SFunction1_o24_l = (real_T)
18123 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].timestamp;
18124 L4_MABX_B.SFunction1_o25_n = (real_T)
18125 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].deltatime;
18126 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18F0010B].data;
18127
18128 /* Decode CAN message */
18129 {
18130 {
18131 rtican_Signal_t CAN_Sgn;
18132
18133 /* ...... "ASREngCtrlActive" (0|2, standard signal, unsigned int, little endian) */
18134 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18135 CAN_Sgn.UnsignedSgn &= 0x00000003;
18136 L4_MABX_B.SFunction1_o1_fp = ((real_T) CAN_Sgn.UnsignedSgn);
18137
18138 /* ...... "ASRBrakeCtrlActive" (2|2, standard signal, unsigned int, little endian) */
18139 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18140 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
18141 CAN_Sgn.UnsignedSgn &= 0x00000003;
18142 L4_MABX_B.SFunction1_o2_fr = ((real_T) CAN_Sgn.UnsignedSgn);
18143
18144 /* ...... "AntiLockBrakingActive" (4|2, standard signal, unsigned int, little endian) */
18145 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18146 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
18147 CAN_Sgn.UnsignedSgn &= 0x00000003;
18148 L4_MABX_B.SFunction1_o3_ja = ((real_T) CAN_Sgn.UnsignedSgn);
18149
18150 /* ...... "EBSBrakeSwitch" (6|2, standard signal, unsigned int, little endian) */
18151 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18152 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
18153 CAN_Sgn.UnsignedSgn &= 0x00000003;
18154 L4_MABX_B.SFunction1_o4_f4 = ((real_T) CAN_Sgn.UnsignedSgn);
18155
18156 /* ...... "BrakePedalPos" (8|8, standard signal, unsigned int, little endian) */
18157 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
18158 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18159 L4_MABX_B.SFunction1_o5_ld = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
18160
18161 /* ...... "ABSOffroadSwitch" (16|2, standard signal, unsigned int, little endian) */
18162 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
18163 CAN_Sgn.UnsignedSgn &= 0x00000003;
18164 L4_MABX_B.SFunction1_o6_n3 = ((real_T) CAN_Sgn.UnsignedSgn);
18165
18166 /* ...... "ASROffroadSwitch" (18|2, standard signal, unsigned int, little endian) */
18167 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
18168 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
18169 CAN_Sgn.UnsignedSgn &= 0x00000003;
18170 L4_MABX_B.SFunction1_o7_e = ((real_T) CAN_Sgn.UnsignedSgn);
18171
18172 /* ...... "ASRHillHolderSwitch" (20|2, standard signal, unsigned int, little endian) */
18173 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
18174 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
18175 CAN_Sgn.UnsignedSgn &= 0x00000003;
18176 L4_MABX_B.SFunction1_o8_e = ((real_T) CAN_Sgn.UnsignedSgn);
18177
18178 /* ...... "TractionCtrlOverrideSwitch" (22|2, standard signal, unsigned int, little endian) */
18179 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
18180 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
18181 CAN_Sgn.UnsignedSgn &= 0x00000003;
18182 L4_MABX_B.SFunction1_o9_ia = ((real_T) CAN_Sgn.UnsignedSgn);
18183
18184 /* ...... "AccelInterlockSwitch" (24|2, standard signal, unsigned int, little endian) */
18185 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
18186 CAN_Sgn.UnsignedSgn &= 0x00000003;
18187 L4_MABX_B.SFunction1_o10_f5 = ((real_T) CAN_Sgn.UnsignedSgn);
18188
18189 /* ...... "EngDerateSwitch" (26|2, standard signal, unsigned int, little endian) */
18190 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
18191 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
18192 CAN_Sgn.UnsignedSgn &= 0x00000003;
18193 L4_MABX_B.SFunction1_o11_d = ((real_T) CAN_Sgn.UnsignedSgn);
18194
18195 /* ...... "EngAuxShutdownSwitch" (28|2, standard signal, unsigned int, little endian) */
18196 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
18197 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
18198 CAN_Sgn.UnsignedSgn &= 0x00000003;
18199 L4_MABX_B.SFunction1_o12_a = ((real_T) CAN_Sgn.UnsignedSgn);
18200
18201 /* ...... "RemoteAccelEnableSwitch" (30|2, standard signal, unsigned int, little endian) */
18202 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
18203 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
18204 CAN_Sgn.UnsignedSgn &= 0x00000003;
18205 L4_MABX_B.SFunction1_o13_k = ((real_T) CAN_Sgn.UnsignedSgn);
18206
18207 /* ...... "EngRetarderSelection" (32|8, standard signal, unsigned int, little endian) */
18208 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
18209 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18210 L4_MABX_B.SFunction1_o14_g = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
18211
18212 /* ...... "ABSFullyOperational" (40|2, standard signal, unsigned int, little endian) */
18213 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
18214 CAN_Sgn.UnsignedSgn &= 0x00000003;
18215 L4_MABX_B.SFunction1_o15_e = ((real_T) CAN_Sgn.UnsignedSgn);
18216
18217 /* ...... "EBSRedWarningSignal" (42|2, standard signal, unsigned int, little endian) */
18218 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
18219 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
18220 CAN_Sgn.UnsignedSgn &= 0x00000003;
18221 L4_MABX_B.SFunction1_o16_h = ((real_T) CAN_Sgn.UnsignedSgn);
18222
18223 /* ...... "ABS_EBSAmberWarningSignal" (44|2, standard signal, unsigned int, little endian) */
18224 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
18225 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
18226 CAN_Sgn.UnsignedSgn &= 0x00000003;
18227 L4_MABX_B.SFunction1_o17_n = ((real_T) CAN_Sgn.UnsignedSgn);
18228
18229 /* ...... "ATC_ASRInformationSignal" (46|2, standard signal, unsigned int, little endian) */
18230 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
18231 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
18232 CAN_Sgn.UnsignedSgn &= 0x00000003;
18233 L4_MABX_B.SFunction1_o18_h = ((real_T) CAN_Sgn.UnsignedSgn);
18234
18235 /* ...... "SrcAddrssOfCtrllngDvcFrBrkCntrl" (48|8, standard signal, unsigned int, little endian) */
18236 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
18237 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18238 L4_MABX_B.SFunction1_o19_n = ((real_T) CAN_Sgn.UnsignedSgn);
18239
18240 /* ...... "HaltBrakeSwitch" (58|2, standard signal, unsigned int, little endian) */
18241 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
18242 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
18243 CAN_Sgn.UnsignedSgn &= 0x00000003;
18244 L4_MABX_B.SFunction1_o20_d = ((real_T) CAN_Sgn.UnsignedSgn);
18245
18246 /* ...... "TrailerABSStatus" (60|2, standard signal, unsigned int, little endian) */
18247 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
18248 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
18249 CAN_Sgn.UnsignedSgn &= 0x00000003;
18250 L4_MABX_B.SFunction1_o21_a = ((real_T) CAN_Sgn.UnsignedSgn);
18251
18252 /* ...... "TrctrMntdTrilerABSWarningSignal" (62|2, standard signal, unsigned int, little endian) */
18253 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
18254 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
18255 CAN_Sgn.UnsignedSgn &= 0x00000003;
18256 L4_MABX_B.SFunction1_o22_o = ((real_T) CAN_Sgn.UnsignedSgn);
18257 }
18258 }
18259 } else {
18260 /* set RX status to 0 because no new message has arrived */
18261 L4_MABX_B.SFunction1_o23_k = 0.0;
18262 }
18263 }
18264 }
18265
18266 /* End of Constant: '<S433>/Constant1' */
18267 /* End of Outputs for SubSystem: '<S514>/EBC1_0B' */
18268
18269 /* DataTypeConversion: '<S514>/Data Type Conversion10' */
18270 L4_MABX_B.RX_delta_time_f = L4_MABX_B.SFunction1_o25_n;
18271
18272 /* DataTypeConversion: '<S514>/Data Type Conversion8' */
18273 L4_MABX_B.RX_status_hs = (L4_MABX_B.SFunction1_o23_k != 0.0);
18274
18275 /* DataTypeConversion: '<S514>/Data Type Conversion9' */
18276 L4_MABX_B.RX_time_a = L4_MABX_B.SFunction1_o24_l;
18277
18278 /* DataTypeConversion: '<S516>/Data Type Conversion10' */
18279 L4_MABX_B.RX_delta_time_o = L4_MABX_B.SFunction1_o25_p;
18280
18281 /* DataTypeConversion: '<S516>/Data Type Conversion8' */
18282 L4_MABX_B.RX_status_l = (L4_MABX_B.SFunction1_o23_i != 0.0);
18283
18284 /* DataTypeConversion: '<S516>/Data Type Conversion9' */
18285 L4_MABX_B.RX_time_g = L4_MABX_B.SFunction1_o24_a;
18286
18287 /* DataTypeConversion: '<S518>/Data Type Conversion10' */
18288 L4_MABX_B.RX_delta_time_mk = L4_MABX_B.SFunction1_o10_ey;
18289
18290 /* DataTypeConversion: '<S518>/Data Type Conversion8' */
18291 L4_MABX_B.RX_status_he = (L4_MABX_B.SFunction1_o8_g != 0.0);
18292
18293 /* DataTypeConversion: '<S518>/Data Type Conversion9' */
18294 L4_MABX_B.RX_time_ad = L4_MABX_B.SFunction1_o9_cm;
18295
18296 /* DataTypeConversion: '<S565>/Data Type Conversion10' */
18297 L4_MABX_B.RX_delta_time_m3 = L4_MABX_B.SFunction1_o11_g;
18298
18299 /* DataTypeConversion: '<S565>/Data Type Conversion8' */
18300 L4_MABX_B.RX_status_k = (L4_MABX_B.SFunction1_o9_px != 0.0);
18301
18302 /* DataTypeConversion: '<S565>/Data Type Conversion9' */
18303 L4_MABX_B.RX_time_oj = L4_MABX_B.SFunction1_o10_ft;
18304
18305 /* Outputs for Enabled SubSystem: '<S567>/EEC2_001' incorporates:
18306 * EnablePort: '<S568>/Enable'
18307 */
18308 /* Constant: '<S438>/Enable_RX_EEC2_00' */
18309 if (L4_MABX_P.Enable_RX_EEC2_00_Value) {
18310 /* S-Function (rti_commonblock): '<S568>/S-Function1' */
18311 /* This comment workarounds a code generation problem */
18312
18313 /* dSPACE RTICAN RX Message Block: "EEC2_00" Id:217056000 */
18314 {
18315 UInt32 *CAN_Msg;
18316 static dsfloat time_old = 0.0;
18317
18318 /* Read status and timestamp info (previous message) */
18319 if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].timestamp !=
18320 time_old) {
18321 /* ... save timestamp info for the calculation of the RX status
18322 during the consecutive sample hit*/
18323 time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].
18324 timestamp;
18325
18326 /* ... set the processed flag to one */
18327 L4_MABX_B.SFunction1_o15_p = 1.0;
18328 L4_MABX_B.SFunction1_o16_n = (real_T)
18329 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].timestamp;
18330 L4_MABX_B.SFunction1_o17_p = (real_T)
18331 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].deltatime;
18332 CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0xCF00300].data;
18333
18334 /* Decode CAN message */
18335 {
18336 {
18337 rtican_Signal_t CAN_Sgn;
18338
18339 /* ...... "SPN558_AccelPed1LowIdlSwitch" (0|2, standard signal, unsigned int, little endian) */
18340 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18341 CAN_Sgn.UnsignedSgn &= 0x00000003;
18342 L4_MABX_B.SFunction1_o1_dx = ((real_T) CAN_Sgn.UnsignedSgn);
18343
18344 /* ...... "SPN559_AccelPedKickdownSw" (2|2, standard signal, unsigned int, little endian) */
18345 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18346 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
18347 CAN_Sgn.UnsignedSgn &= 0x00000003;
18348 L4_MABX_B.SFunction1_o2_h1 = ((real_T) CAN_Sgn.UnsignedSgn);
18349
18350 /* ...... "SPN1437_RoadSpeedLimitStatus" (4|2, standard signal, unsigned int, little endian) */
18351 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18352 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
18353 CAN_Sgn.UnsignedSgn &= 0x00000003;
18354 L4_MABX_B.SFunction1_o3_ee = ((real_T) CAN_Sgn.UnsignedSgn);
18355
18356 /* ...... "SPN2970_AccelPed2LowIdlSwitch" (6|2, standard signal, unsigned int, little endian) */
18357 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18358 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
18359 CAN_Sgn.UnsignedSgn &= 0x00000003;
18360 L4_MABX_B.SFunction1_o4_gk = ((real_T) CAN_Sgn.UnsignedSgn);
18361
18362 /* ...... "SPN91_AccelPedPos1" (8|8, standard signal, unsigned int, little endian) */
18363 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
18364 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18365 L4_MABX_B.SFunction1_o5_m2 = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
18366
18367 /* ...... "SPN92_EngPercLoadAtCurrSpd" (16|8, standard signal, unsigned int, little endian) */
18368 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
18369 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18370 L4_MABX_B.SFunction1_o6_k = ((real_T) CAN_Sgn.UnsignedSgn);
18371
18372 /* ...... "SPN974_RemAccelPedalPosition" (24|8, standard signal, unsigned int, little endian) */
18373 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
18374 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18375 L4_MABX_B.SFunction1_o7_oo = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
18376
18377 /* ...... "SPN29_AccelPedPos2" (32|8, standard signal, unsigned int, little endian) */
18378 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
18379 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18380 L4_MABX_B.SFunction1_o8_a2 = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
18381
18382 /* ...... "SPN2979_VehAccelRateLimStatus" (40|2, standard signal, unsigned int, little endian) */
18383 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
18384 CAN_Sgn.UnsignedSgn &= 0x00000003;
18385 L4_MABX_B.SFunction1_o9_ge = ((real_T) CAN_Sgn.UnsignedSgn);
18386
18387 /* ...... "SPN5021_MomEngMaxPwrEnFdbk" (42|2, standard signal, unsigned int, little endian) */
18388 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
18389 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
18390 CAN_Sgn.UnsignedSgn &= 0x00000003;
18391 L4_MABX_B.SFunction1_o10_f = ((real_T) CAN_Sgn.UnsignedSgn);
18392
18393 /* ...... "SPN5399_DPFThermMgmtActive" (44|2, standard signal, unsigned int, little endian) */
18394 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
18395 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
18396 CAN_Sgn.UnsignedSgn &= 0x00000003;
18397 L4_MABX_B.SFunction1_o11_n = ((real_T) CAN_Sgn.UnsignedSgn);
18398
18399 /* ...... "SPN5400_SCRThermMgmtActive" (46|2, standard signal, unsigned int, little endian) */
18400 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
18401 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 6;
18402 CAN_Sgn.UnsignedSgn &= 0x00000003;
18403 L4_MABX_B.SFunction1_o12_p = ((real_T) CAN_Sgn.UnsignedSgn);
18404
18405 /* ...... "SPN3357_ActMaxAvailEngPercTrq" (48|8, standard signal, unsigned int, little endian) */
18406 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
18407 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18408 L4_MABX_B.SFunction1_o13_h = 0.4 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
18409
18410 /* ...... "SPN5398_EstPumpingPercentTorque" (56|8, standard signal, unsigned int, little endian) */
18411 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
18412 CAN_Sgn.UnsignedSgn &= 0x000000FF;
18413 L4_MABX_B.SFunction1_o14_p = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn)
18414 );
18415 }
18416 }
18417 } else {
18418 /* set RX status to 0 because no new message has arrived */
18419 L4_MABX_B.SFunction1_o15_p = 0.0;
18420 }
18421 }
18422 }
18423
18424 /* End of Constant: '<S438>/Enable_RX_EEC2_00' */
18425 /* End of Outputs for SubSystem: '<S567>/EEC2_001' */
18426
18427 /* DataTypeConversion: '<S567>/Data Type Conversion10' */
18428 L4_MABX_B.RX_delta_time_ne = L4_MABX_B.SFunction1_o17_p;
18429
18430 /* DataTypeConversion: '<S567>/Data Type Conversion8' */
18431 L4_MABX_B.RX_status_os = (L4_MABX_B.SFunction1_o15_p != 0.0);
18432
18433 /* DataTypeConversion: '<S567>/Data Type Conversion9' */
18434 L4_MABX_B.RX_time_h = L4_MABX_B.SFunction1_o16_n;
18435
18436 /* DataTypeConversion: '<S569>/Data Type Conversion10' */
18437 L4_MABX_B.RX_delta_time_c = L4_MABX_B.SFunction1_o5_gf;
18438
18439 /* DataTypeConversion: '<S569>/Data Type Conversion8' */
18440 L4_MABX_B.RX_status_e2 = (L4_MABX_B.SFunction1_o3_ji != 0.0);
18441
18442 /* DataTypeConversion: '<S569>/Data Type Conversion9' */
18443 L4_MABX_B.RX_time_i0 = L4_MABX_B.SFunction1_o4_lp;
18444
18445 /* DataTypeConversion: '<S571>/Data Type Conversion10' */
18446 L4_MABX_B.RX_delta_time_mb = L4_MABX_B.SFunction1_o6_m;
18447
18448 /* DataTypeConversion: '<S571>/Data Type Conversion8' */
18449 L4_MABX_B.RX_status_at = (L4_MABX_B.SFunction1_o4_b3 != 0.0);
18450
18451 /* DataTypeConversion: '<S571>/Data Type Conversion9' */
18452 L4_MABX_B.RX_time_p = L4_MABX_B.SFunction1_o5_lx;
18453
18454 /* Switch: '<S573>/Switch' */
18455 if (L4_MABX_B.RX_status_j) {
18456 L4_MABX_B.SID_l = L4_MABX_B.SFunction1_o1_nf;
18457 L4_MABX_B.SetMode = L4_MABX_B.SFunction1_o2_mj;
18458 L4_MABX_B.OpMode = L4_MABX_B.SFunction1_o3_l3;
18459 L4_MABX_B.VDOP = L4_MABX_B.SFunction1_o5_pl;
18460 L4_MABX_B.TDOP = L4_MABX_B.SFunction1_o6_d;
18461 L4_MABX_B.RX_status_d = L4_MABX_B.RX_status_j;
18462 } else {
18463 L4_MABX_B.SID_l = L4_MABX_B.SFunction1_o1_lr;
18464 L4_MABX_B.SetMode = L4_MABX_B.SFunction1_o2_mt;
18465 L4_MABX_B.OpMode = L4_MABX_B.SFunction1_o3_m3;
18466 L4_MABX_B.VDOP = L4_MABX_B.SFunction1_o5_g5;
18467 L4_MABX_B.TDOP = L4_MABX_B.SFunction1_o6_b;
18468
18469 /* DataTypeConversion: '<S573>/Data Type Conversion3' */
18470 L4_MABX_B.RX_status_p4 = (L4_MABX_B.SFunction1_o7_jo != 0.0);
18471 L4_MABX_B.RX_status_d = L4_MABX_B.RX_status_p4;
18472 }
18473
18474 if (L4_MABX_B.RX_status_j) {
18475 /* DataTypeConversion: '<S573>/Data Type Conversion9' */
18476 L4_MABX_B.RX_time_gm = L4_MABX_B.SFunction1_o8_a4;
18477 L4_MABX_B.RX_time_ij = L4_MABX_B.RX_time_gm;
18478
18479 /* DataTypeConversion: '<S573>/Data Type Conversion10' */
18480 L4_MABX_B.RX_delta_time_g0 = L4_MABX_B.SFunction1_o9_p;
18481 L4_MABX_B.RX_delta_time_ok = L4_MABX_B.RX_delta_time_g0;
18482 } else {
18483 /* DataTypeConversion: '<S573>/Data Type Conversion2' */
18484 L4_MABX_B.RX_time_as = L4_MABX_B.SFunction1_o8_pc;
18485 L4_MABX_B.RX_time_ij = L4_MABX_B.RX_time_as;
18486
18487 /* DataTypeConversion: '<S573>/Data Type Conversion1' */
18488 L4_MABX_B.RX_delta_time_dil = L4_MABX_B.SFunction1_o9_k;
18489 L4_MABX_B.RX_delta_time_ok = L4_MABX_B.RX_delta_time_dil;
18490 }
18491
18492 /* DataTypeConversion: '<S576>/Data Type Conversion10' */
18493 L4_MABX_B.RX_delta_time_h = L4_MABX_B.SFunction1_o7_j;
18494
18495 /* DataTypeConversion: '<S576>/Data Type Conversion8' */
18496 L4_MABX_B.RX_status_ej = (L4_MABX_B.SFunction1_o5_b0 != 0.0);
18497
18498 /* DataTypeConversion: '<S576>/Data Type Conversion9' */
18499 L4_MABX_B.RX_time_kq = L4_MABX_B.SFunction1_o6_a;
18500
18501 /* Switch: '<S443>/Switch' */
18502 if (L4_MABX_B.Operator_jhs) {
18503 ReAX_EchoedSteerWheelPos = L4_MABX_B.SFunction1_o2_kb;
18504
18505 /* DataTypeConversion: '<S578>/Data Type Conversion8' */
18506 L4_MABX_B.RX_status_if = (L4_MABX_B.SFunction1_o3_b != 0.0);
18507 L4_MABX_B.RX_status_d5 = L4_MABX_B.RX_status_if;
18508
18509 /* DataTypeConversion: '<S578>/Data Type Conversion9' */
18510 L4_MABX_B.RX_time_kn = L4_MABX_B.SFunction1_o4_hf;
18511 L4_MABX_B.RX_time_n = L4_MABX_B.RX_time_kn;
18512
18513 /* DataTypeConversion: '<S578>/Data Type Conversion10' */
18514 L4_MABX_B.RX_delta_time_ko = L4_MABX_B.SFunction1_o5_pr;
18515 L4_MABX_B.RX_delta_time_h2 = L4_MABX_B.RX_delta_time_ko;
18516 } else {
18517 ReAX_EchoedSteerWheelPos = L4_MABX_B.SFunction1_o2_jh;
18518
18519 /* DataTypeConversion: '<S579>/Data Type Conversion8' */
18520 L4_MABX_B.RX_status_fz = (L4_MABX_B.SFunction1_o3_ep != 0.0);
18521 L4_MABX_B.RX_status_d5 = L4_MABX_B.RX_status_fz;
18522
18523 /* DataTypeConversion: '<S579>/Data Type Conversion9' */
18524 L4_MABX_B.RX_time_ec = L4_MABX_B.SFunction1_o4_bl;
18525 L4_MABX_B.RX_time_n = L4_MABX_B.RX_time_ec;
18526
18527 /* DataTypeConversion: '<S579>/Data Type Conversion10' */
18528 L4_MABX_B.RX_delta_time_in = L4_MABX_B.SFunction1_o5_my;
18529 L4_MABX_B.RX_delta_time_h2 = L4_MABX_B.RX_delta_time_in;
18530 }
18531
18532 /* RelationalOperator: '<S615>/Operator' incorporates:
18533 * Constant: '<S446>/Constant'
18534 * Constant: '<S611>/Constant'
18535 */
18536 L4_MABX_B.Operator_ahw = (CANR_PROPB_XPR_1_50_CHANNEL_APV ==
18537 L4_MABX_P.Constant_Value_mx);
18538
18539 /* Outputs for Enabled SubSystem: '<S608>/CAN_TYPE1_RX_M1_C1' incorporates:
18540 * EnablePort: '<S612>/Enable'
18541 */
18542 if (L4_MABX_B.Operator_ahw) {
18543 /* S-Function (rti_commonblock): '<S612>/S-Function1' */
18544 /* This comment workarounds a code generation problem */
18545
18546 /* dSPACE RTICAN RX Message Block: "PropB_XPR_1" Id:419387472 */
18547 {
18548 UInt32 *CAN_Msg;
18549 static dsfloat time_old = 0.0;
18550
18551 /* Read status and timestamp info (previous message) */
18552 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].timestamp !=
18553 time_old) {
18554 /* ... save timestamp info for the calculation of the RX status
18555 during the consecutive sample hit*/
18556 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].
18557 timestamp;
18558
18559 /* ... set the processed flag to one */
18560 L4_MABX_B.SFunction1_o3_ek = 1.0;
18561 L4_MABX_B.SFunction1_o4_ex = (real_T)
18562 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].timestamp;
18563 L4_MABX_B.SFunction1_o5_kn = (real_T)
18564 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].deltatime;
18565 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FF5850].data;
18566
18567 /* Decode CAN message */
18568 {
18569 {
18570 rtican_Signal_t CAN_Sgn;
18571
18572 /* ...... "EPBPCMInhibitStatusFeedback" (0|2, standard signal, unsigned int, little endian) */
18573 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18574 CAN_Sgn.UnsignedSgn &= 0x00000003;
18575 L4_MABX_B.SFunction1_o1_a54 = ((real_T) CAN_Sgn.UnsignedSgn);
18576
18577 /* ...... "EPBPCMManualStatusFeedback" (2|2, standard signal, unsigned int, little endian) */
18578 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18579 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
18580 CAN_Sgn.UnsignedSgn &= 0x00000003;
18581 L4_MABX_B.SFunction1_o2_kd = ((real_T) CAN_Sgn.UnsignedSgn);
18582 }
18583 }
18584 } else {
18585 /* set RX status to 0 because no new message has arrived */
18586 L4_MABX_B.SFunction1_o3_ek = 0.0;
18587 }
18588 }
18589 }
18590
18591 /* End of Outputs for SubSystem: '<S608>/CAN_TYPE1_RX_M1_C1' */
18592
18593 /* RelationalOperator: '<S616>/Operator' incorporates:
18594 * Constant: '<S446>/Constant'
18595 * Constant: '<S611>/Constant1'
18596 */
18597 L4_MABX_B.Operator_owm = (CANR_PROPB_XPR_1_50_CHANNEL_APV ==
18598 L4_MABX_P.Constant1_Value_ai);
18599
18600 /* Outputs for Enabled SubSystem: '<S609>/CAN_TYPE1_RX_M1_C2' incorporates:
18601 * EnablePort: '<S613>/Enable'
18602 */
18603 if (L4_MABX_B.Operator_owm) {
18604 /* S-Function (rti_commonblock): '<S613>/S-Function1' */
18605 /* This comment workarounds a code generation problem */
18606
18607 /* dSPACE RTICAN RX Message Block: "PropB_XPR_1" Id:419387472 */
18608 {
18609 UInt32 *CAN_Msg;
18610 static dsfloat time_old = 0.0;
18611
18612 /* Read status and timestamp info (previous message) */
18613 if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].timestamp !=
18614 time_old) {
18615 /* ... save timestamp info for the calculation of the RX status
18616 during the consecutive sample hit*/
18617 time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].
18618 timestamp;
18619
18620 /* ... set the processed flag to one */
18621 L4_MABX_B.SFunction1_o3_oh = 1.0;
18622 L4_MABX_B.SFunction1_o4_jd = (real_T)
18623 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].timestamp;
18624 L4_MABX_B.SFunction1_o5_mw = (real_T)
18625 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].deltatime;
18626 CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FF5850].data;
18627
18628 /* Decode CAN message */
18629 {
18630 {
18631 rtican_Signal_t CAN_Sgn;
18632
18633 /* ...... "EPBPCMInhibitStatusFeedback" (0|2, standard signal, unsigned int, little endian) */
18634 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18635 CAN_Sgn.UnsignedSgn &= 0x00000003;
18636 L4_MABX_B.SFunction1_o1_a1 = ((real_T) CAN_Sgn.UnsignedSgn);
18637
18638 /* ...... "EPBPCMManualStatusFeedback" (2|2, standard signal, unsigned int, little endian) */
18639 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18640 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
18641 CAN_Sgn.UnsignedSgn &= 0x00000003;
18642 L4_MABX_B.SFunction1_o2_dg = ((real_T) CAN_Sgn.UnsignedSgn);
18643 }
18644 }
18645 } else {
18646 /* set RX status to 0 because no new message has arrived */
18647 L4_MABX_B.SFunction1_o3_oh = 0.0;
18648 }
18649 }
18650 }
18651
18652 /* End of Outputs for SubSystem: '<S609>/CAN_TYPE1_RX_M1_C2' */
18653
18654 /* RelationalOperator: '<S617>/Operator' incorporates:
18655 * Constant: '<S446>/Constant'
18656 * Constant: '<S611>/Constant2'
18657 */
18658 L4_MABX_B.Operator_ad = (CANR_PROPB_XPR_1_50_CHANNEL_APV ==
18659 L4_MABX_P.Constant2_Value_ln);
18660
18661 /* Outputs for Enabled SubSystem: '<S610>/CAN_TYPE1_RX_M2_C1' incorporates:
18662 * EnablePort: '<S614>/Enable'
18663 */
18664 if (L4_MABX_B.Operator_ad) {
18665 /* S-Function (rti_commonblock): '<S614>/S-Function1' */
18666 /* This comment workarounds a code generation problem */
18667
18668 /* dSPACE RTICAN RX Message Block: "PropB_XPR_1" Id:419387472 */
18669 {
18670 UInt32 *CAN_Msg;
18671 static dsfloat time_old = 0.0;
18672
18673 /* Read status and timestamp info (previous message) */
18674 if (can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].timestamp !=
18675 time_old) {
18676 /* ... save timestamp info for the calculation of the RX status
18677 during the consecutive sample hit*/
18678 time_old = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].
18679 timestamp;
18680
18681 /* ... set the processed flag to one */
18682 L4_MABX_B.SFunction1_o3_atb = 1.0;
18683 L4_MABX_B.SFunction1_o4_h3 = (real_T)
18684 can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].timestamp;
18685 L4_MABX_B.SFunction1_o5_f3f = (real_T)
18686 can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].deltatime;
18687 CAN_Msg = can_type1_M2_C1_XTD[CANTP1_M2_C1_RXSRVC_XTD_0x18FF5850].data;
18688
18689 /* Decode CAN message */
18690 {
18691 {
18692 rtican_Signal_t CAN_Sgn;
18693
18694 /* ...... "EPBPCMInhibitStatusFeedback" (0|2, standard signal, unsigned int, little endian) */
18695 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18696 CAN_Sgn.UnsignedSgn &= 0x00000003;
18697 L4_MABX_B.SFunction1_o1_lv = ((real_T) CAN_Sgn.UnsignedSgn);
18698
18699 /* ...... "EPBPCMManualStatusFeedback" (2|2, standard signal, unsigned int, little endian) */
18700 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
18701 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
18702 CAN_Sgn.UnsignedSgn &= 0x00000003;
18703 L4_MABX_B.SFunction1_o2_f = ((real_T) CAN_Sgn.UnsignedSgn);
18704 }
18705 }
18706 } else {
18707 /* set RX status to 0 because no new message has arrived */
18708 L4_MABX_B.SFunction1_o3_atb = 0.0;
18709 }
18710 }
18711 }
18712
18713 /* End of Outputs for SubSystem: '<S610>/CAN_TYPE1_RX_M2_C1' */
18714
18715 /* DataTypeConversion: '<S610>/Data Type Conversion' */
18716 PositionFinalLimited = L4_MABX_B.SFunction1_o1_lv;
18717 if (PositionFinalLimited < 256.0) {
18718 if (PositionFinalLimited >= 0.0) {
18719 starting_index = (uint8_T)PositionFinalLimited;
18720 } else {
18721 starting_index = 0U;
18722 }
18723 } else {
18724 starting_index = MAX_uint8_T;
18725 }
18726
18727 L4_MABX_B.DataTypeConversion_ai = starting_index;
18728
18729 /* End of DataTypeConversion: '<S610>/Data Type Conversion' */
18730
18731 /* DataTypeConversion: '<S610>/Data Type Conversion2' */
18732 L4_MABX_B.EPBPCMInhibitStatusFeedback = (ENUM_XPR_FEEDBACK_T)
18733 L4_MABX_B.DataTypeConversion_ai;
18734
18735 /* MultiPortSwitch: '<S446>/Multiport_Switch' incorporates:
18736 * Constant: '<S446>/Constant'
18737 */
18738 switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) {
18739 case ENUM_CAN_RX_T_RX_CAN_1:
18740 /* DataTypeConversion: '<S608>/Data Type Conversion' */
18741 PositionFinalLimited = L4_MABX_B.SFunction1_o1_a54;
18742 if (PositionFinalLimited < 256.0) {
18743 if (PositionFinalLimited >= 0.0) {
18744 starting_index = (uint8_T)PositionFinalLimited;
18745 } else {
18746 starting_index = 0U;
18747 }
18748 } else {
18749 starting_index = MAX_uint8_T;
18750 }
18751
18752 L4_MABX_B.DataTypeConversion_kz = starting_index;
18753
18754 /* End of DataTypeConversion: '<S608>/Data Type Conversion' */
18755
18756 /* DataTypeConversion: '<S608>/Data Type Conversion2' */
18757 L4_MABX_B.EPBPCMInhibitStatusFeedback_m = (ENUM_XPR_FEEDBACK_T)
18758 L4_MABX_B.DataTypeConversion_kz;
18759 L4_MABX_B.EPBPCMInhibitStatusFeedback_f =
18760 L4_MABX_B.EPBPCMInhibitStatusFeedback_m;
18761 break;
18762
18763 case ENUM_CAN_RX_T_RX_CAN_2:
18764 /* DataTypeConversion: '<S609>/Data Type Conversion' */
18765 PositionFinalLimited = L4_MABX_B.SFunction1_o1_a1;
18766 if (PositionFinalLimited < 256.0) {
18767 if (PositionFinalLimited >= 0.0) {
18768 starting_index = (uint8_T)PositionFinalLimited;
18769 } else {
18770 starting_index = 0U;
18771 }
18772 } else {
18773 starting_index = MAX_uint8_T;
18774 }
18775
18776 L4_MABX_B.DataTypeConversion_hh = starting_index;
18777
18778 /* End of DataTypeConversion: '<S609>/Data Type Conversion' */
18779
18780 /* DataTypeConversion: '<S609>/Data Type Conversion2' */
18781 L4_MABX_B.EPBPCMInhibitStatusFeedback_i = (ENUM_XPR_FEEDBACK_T)
18782 L4_MABX_B.DataTypeConversion_hh;
18783 L4_MABX_B.EPBPCMInhibitStatusFeedback_f =
18784 L4_MABX_B.EPBPCMInhibitStatusFeedback_i;
18785 break;
18786
18787 case ENUM_CAN_RX_T_RX_CAN_3:
18788 L4_MABX_B.EPBPCMInhibitStatusFeedback_f =
18789 L4_MABX_B.EPBPCMInhibitStatusFeedback;
18790 break;
18791
18792 case ENUM_CAN_RX_T_RX_CAN_4:
18793 L4_MABX_B.EPBPCMInhibitStatusFeedback_f =
18794 L4_MABX_B.EPBPCMInhibitStatusFeedback;
18795 break;
18796
18797 case ENUM_CAN_RX_T_RX_CAN_5:
18798 L4_MABX_B.EPBPCMInhibitStatusFeedback_f =
18799 L4_MABX_B.EPBPCMInhibitStatusFeedback;
18800 break;
18801
18802 case ENUM_CAN_RX_T_RX_CAN_6:
18803 L4_MABX_B.EPBPCMInhibitStatusFeedback_f =
18804 L4_MABX_B.EPBPCMInhibitStatusFeedback;
18805 break;
18806
18807 default:
18808 L4_MABX_B.EPBPCMInhibitStatusFeedback_f =
18809 L4_MABX_B.EPBPCMInhibitStatusFeedback;
18810 break;
18811 }
18812
18813 /* DataTypeConversion: '<S610>/Data Type Conversion1' */
18814 PositionFinalLimited = L4_MABX_B.SFunction1_o2_f;
18815 if (PositionFinalLimited < 256.0) {
18816 if (PositionFinalLimited >= 0.0) {
18817 starting_index = (uint8_T)PositionFinalLimited;
18818 } else {
18819 starting_index = 0U;
18820 }
18821 } else {
18822 starting_index = MAX_uint8_T;
18823 }
18824
18825 L4_MABX_B.DataTypeConversion1_ct = starting_index;
18826
18827 /* End of DataTypeConversion: '<S610>/Data Type Conversion1' */
18828
18829 /* DataTypeConversion: '<S610>/Data Type Conversion3' */
18830 L4_MABX_B.EPBPCMManualStatusFeedback = (ENUM_XPR_FEEDBACK_T)
18831 L4_MABX_B.DataTypeConversion1_ct;
18832
18833 /* MultiPortSwitch: '<S446>/Multiport_Switch' incorporates:
18834 * Constant: '<S446>/Constant'
18835 */
18836 switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) {
18837 case ENUM_CAN_RX_T_RX_CAN_1:
18838 /* DataTypeConversion: '<S608>/Data Type Conversion1' */
18839 PositionFinalLimited = L4_MABX_B.SFunction1_o2_kd;
18840 if (PositionFinalLimited < 256.0) {
18841 if (PositionFinalLimited >= 0.0) {
18842 starting_index = (uint8_T)PositionFinalLimited;
18843 } else {
18844 starting_index = 0U;
18845 }
18846 } else {
18847 starting_index = MAX_uint8_T;
18848 }
18849
18850 L4_MABX_B.DataTypeConversion1_ae = starting_index;
18851
18852 /* End of DataTypeConversion: '<S608>/Data Type Conversion1' */
18853
18854 /* DataTypeConversion: '<S608>/Data Type Conversion3' */
18855 L4_MABX_B.EPBPCMManualStatusFeedback_d = (ENUM_XPR_FEEDBACK_T)
18856 L4_MABX_B.DataTypeConversion1_ae;
18857 L4_MABX_B.EPBPCMManualStatusFeedback_m =
18858 L4_MABX_B.EPBPCMManualStatusFeedback_d;
18859 break;
18860
18861 case ENUM_CAN_RX_T_RX_CAN_2:
18862 /* DataTypeConversion: '<S609>/Data Type Conversion1' */
18863 PositionFinalLimited = L4_MABX_B.SFunction1_o2_dg;
18864 if (PositionFinalLimited < 256.0) {
18865 if (PositionFinalLimited >= 0.0) {
18866 starting_index = (uint8_T)PositionFinalLimited;
18867 } else {
18868 starting_index = 0U;
18869 }
18870 } else {
18871 starting_index = MAX_uint8_T;
18872 }
18873
18874 L4_MABX_B.DataTypeConversion1_bl = starting_index;
18875
18876 /* End of DataTypeConversion: '<S609>/Data Type Conversion1' */
18877
18878 /* DataTypeConversion: '<S609>/Data Type Conversion3' */
18879 L4_MABX_B.EPBPCMManualStatusFeedback_f = (ENUM_XPR_FEEDBACK_T)
18880 L4_MABX_B.DataTypeConversion1_bl;
18881 L4_MABX_B.EPBPCMManualStatusFeedback_m =
18882 L4_MABX_B.EPBPCMManualStatusFeedback_f;
18883 break;
18884
18885 case ENUM_CAN_RX_T_RX_CAN_3:
18886 L4_MABX_B.EPBPCMManualStatusFeedback_m =
18887 L4_MABX_B.EPBPCMManualStatusFeedback;
18888 break;
18889
18890 case ENUM_CAN_RX_T_RX_CAN_4:
18891 L4_MABX_B.EPBPCMManualStatusFeedback_m =
18892 L4_MABX_B.EPBPCMManualStatusFeedback;
18893 break;
18894
18895 case ENUM_CAN_RX_T_RX_CAN_5:
18896 L4_MABX_B.EPBPCMManualStatusFeedback_m =
18897 L4_MABX_B.EPBPCMManualStatusFeedback;
18898 break;
18899
18900 case ENUM_CAN_RX_T_RX_CAN_6:
18901 L4_MABX_B.EPBPCMManualStatusFeedback_m =
18902 L4_MABX_B.EPBPCMManualStatusFeedback;
18903 break;
18904
18905 default:
18906 L4_MABX_B.EPBPCMManualStatusFeedback_m =
18907 L4_MABX_B.EPBPCMManualStatusFeedback;
18908 break;
18909 }
18910
18911 /* DataTypeConversion: '<S610>/Data Type Conversion8' */
18912 L4_MABX_B.RX_status_eh = (L4_MABX_B.SFunction1_o3_atb != 0.0);
18913
18914 /* MultiPortSwitch: '<S446>/Multiport_Switch' incorporates:
18915 * Constant: '<S446>/Constant'
18916 */
18917 switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) {
18918 case ENUM_CAN_RX_T_RX_CAN_1:
18919 /* DataTypeConversion: '<S608>/Data Type Conversion8' */
18920 L4_MABX_B.RX_status_g = (L4_MABX_B.SFunction1_o3_ek != 0.0);
18921 L4_MABX_B.RX_status_d0 = L4_MABX_B.RX_status_g;
18922 break;
18923
18924 case ENUM_CAN_RX_T_RX_CAN_2:
18925 /* DataTypeConversion: '<S609>/Data Type Conversion8' */
18926 L4_MABX_B.RX_status_nw = (L4_MABX_B.SFunction1_o3_oh != 0.0);
18927 L4_MABX_B.RX_status_d0 = L4_MABX_B.RX_status_nw;
18928 break;
18929
18930 case ENUM_CAN_RX_T_RX_CAN_3:
18931 L4_MABX_B.RX_status_d0 = L4_MABX_B.RX_status_eh;
18932 break;
18933
18934 case ENUM_CAN_RX_T_RX_CAN_4:
18935 L4_MABX_B.RX_status_d0 = L4_MABX_B.RX_status_eh;
18936 break;
18937
18938 case ENUM_CAN_RX_T_RX_CAN_5:
18939 L4_MABX_B.RX_status_d0 = L4_MABX_B.RX_status_eh;
18940 break;
18941
18942 case ENUM_CAN_RX_T_RX_CAN_6:
18943 L4_MABX_B.RX_status_d0 = L4_MABX_B.RX_status_eh;
18944 break;
18945
18946 default:
18947 L4_MABX_B.RX_status_d0 = L4_MABX_B.RX_status_eh;
18948 break;
18949 }
18950
18951 /* DataTypeConversion: '<S610>/Data Type Conversion9' */
18952 L4_MABX_B.RX_time_gp = L4_MABX_B.SFunction1_o4_h3;
18953
18954 /* MultiPortSwitch: '<S446>/Multiport_Switch' incorporates:
18955 * Constant: '<S446>/Constant'
18956 */
18957 switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) {
18958 case ENUM_CAN_RX_T_RX_CAN_1:
18959 /* DataTypeConversion: '<S608>/Data Type Conversion9' */
18960 L4_MABX_B.RX_time_e = L4_MABX_B.SFunction1_o4_ex;
18961 L4_MABX_B.RX_time_cd = L4_MABX_B.RX_time_e;
18962 break;
18963
18964 case ENUM_CAN_RX_T_RX_CAN_2:
18965 /* DataTypeConversion: '<S609>/Data Type Conversion9' */
18966 L4_MABX_B.RX_time_kt = L4_MABX_B.SFunction1_o4_jd;
18967 L4_MABX_B.RX_time_cd = L4_MABX_B.RX_time_kt;
18968 break;
18969
18970 case ENUM_CAN_RX_T_RX_CAN_3:
18971 L4_MABX_B.RX_time_cd = L4_MABX_B.RX_time_gp;
18972 break;
18973
18974 case ENUM_CAN_RX_T_RX_CAN_4:
18975 L4_MABX_B.RX_time_cd = L4_MABX_B.RX_time_gp;
18976 break;
18977
18978 case ENUM_CAN_RX_T_RX_CAN_5:
18979 L4_MABX_B.RX_time_cd = L4_MABX_B.RX_time_gp;
18980 break;
18981
18982 case ENUM_CAN_RX_T_RX_CAN_6:
18983 L4_MABX_B.RX_time_cd = L4_MABX_B.RX_time_gp;
18984 break;
18985
18986 default:
18987 L4_MABX_B.RX_time_cd = L4_MABX_B.RX_time_gp;
18988 break;
18989 }
18990
18991 /* DataTypeConversion: '<S610>/Data Type Conversion10' */
18992 L4_MABX_B.RX_delta_time_h1 = L4_MABX_B.SFunction1_o5_f3f;
18993
18994 /* MultiPortSwitch: '<S446>/Multiport_Switch' incorporates:
18995 * Constant: '<S446>/Constant'
18996 */
18997 switch (CANR_PROPB_XPR_1_50_CHANNEL_APV) {
18998 case ENUM_CAN_RX_T_RX_CAN_1:
18999 /* DataTypeConversion: '<S608>/Data Type Conversion10' */
19000 L4_MABX_B.RX_delta_time_pk = L4_MABX_B.SFunction1_o5_kn;
19001 L4_MABX_B.RX_delta_time_h3 = L4_MABX_B.RX_delta_time_pk;
19002 break;
19003
19004 case ENUM_CAN_RX_T_RX_CAN_2:
19005 /* DataTypeConversion: '<S609>/Data Type Conversion10' */
19006 L4_MABX_B.RX_delta_time_h14 = L4_MABX_B.SFunction1_o5_mw;
19007 L4_MABX_B.RX_delta_time_h3 = L4_MABX_B.RX_delta_time_h14;
19008 break;
19009
19010 case ENUM_CAN_RX_T_RX_CAN_3:
19011 L4_MABX_B.RX_delta_time_h3 = L4_MABX_B.RX_delta_time_h1;
19012 break;
19013
19014 case ENUM_CAN_RX_T_RX_CAN_4:
19015 L4_MABX_B.RX_delta_time_h3 = L4_MABX_B.RX_delta_time_h1;
19016 break;
19017
19018 case ENUM_CAN_RX_T_RX_CAN_5:
19019 L4_MABX_B.RX_delta_time_h3 = L4_MABX_B.RX_delta_time_h1;
19020 break;
19021
19022 case ENUM_CAN_RX_T_RX_CAN_6:
19023 L4_MABX_B.RX_delta_time_h3 = L4_MABX_B.RX_delta_time_h1;
19024 break;
19025
19026 default:
19027 L4_MABX_B.RX_delta_time_h3 = L4_MABX_B.RX_delta_time_h1;
19028 break;
19029 }
19030
19031 /* RelationalOperator: '<S618>/Operator' incorporates:
19032 * Constant: '<S446>/Constant'
19033 * Constant: '<S611>/Constant3'
19034 */
19035 L4_MABX_B.Operator_e0 = (CANR_PROPB_XPR_1_50_CHANNEL_APV ==
19036 L4_MABX_P.Constant3_Value_f);
19037
19038 /* RelationalOperator: '<S619>/Operator' incorporates:
19039 * Constant: '<S446>/Constant'
19040 * Constant: '<S611>/Constant4'
19041 */
19042 L4_MABX_B.Operator_jj = (CANR_PROPB_XPR_1_50_CHANNEL_APV ==
19043 L4_MABX_P.Constant4_Value_a);
19044
19045 /* RelationalOperator: '<S620>/Operator' incorporates:
19046 * Constant: '<S446>/Constant'
19047 * Constant: '<S611>/Constant5'
19048 */
19049 L4_MABX_B.Operator_ni = (CANR_PROPB_XPR_1_50_CHANNEL_APV ==
19050 L4_MABX_P.Constant5_Value_k);
19051
19052 /* Outputs for Enabled SubSystem: '<S621>/PX2_LaneEdgeLeft' incorporates:
19053 * EnablePort: '<S622>/Enable'
19054 */
19055 /* Constant: '<S447>/Constant' */
19056 if (L4_MABX_P.Constant_Value_pa) {
19057 /* S-Function (rti_commonblock): '<S622>/S-Function1' */
19058 /* This comment workarounds a code generation problem */
19059
19060 /* dSPACE RTICAN RX Message Block: "PX2_LaneEdgeLeft" Id:770 */
19061 {
19062 UInt32 *CAN_Msg;
19063 static dsfloat time_old = 0.0;
19064
19065 /* Read status and timestamp info (previous message) */
19066 if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].timestamp !=
19067 time_old) {
19068 /* ... save timestamp info for the calculation of the RX status
19069 during the consecutive sample hit*/
19070 time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].timestamp;
19071
19072 /* ... set the processed flag to one */
19073 L4_MABX_B.SFunction1_o4_pa = 1.0;
19074 L4_MABX_B.SFunction1_o5_br = (real_T)
19075 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].timestamp;
19076 L4_MABX_B.SFunction1_o6_p3 = (real_T)
19077 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].deltatime;
19078 CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x302].data;
19079
19080 /* Decode CAN message */
19081 {
19082 {
19083 rtican_Signal_t CAN_Sgn;
19084
19085 /* ...... "PX2_LaneEdgeLeftAngle" (0|16, standard signal, signed int, little endian) */
19086 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
19087 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
19088 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19089 if (CAN_Sgn.SignedSgn >> 15) {
19090 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19091 }
19092
19093 L4_MABX_B.SFunction1_o1_lb = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
19094
19095 /* ...... "PX2_LaneEdgeLeftNumPoints" (16|8, standard signal, unsigned int, little endian) */
19096 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
19097 CAN_Sgn.UnsignedSgn &= 0x000000FF;
19098 L4_MABX_B.SFunction1_o2_om = ((real_T) CAN_Sgn.UnsignedSgn);
19099
19100 /* ...... "PX2_LaneEdgeLeftPosition" (24|16, standard signal, signed int, little endian) */
19101 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
19102 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
19103 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19104 if (CAN_Sgn.SignedSgn >> 15) {
19105 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19106 }
19107
19108 L4_MABX_B.SFunction1_o3_gw = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) );
19109 }
19110 }
19111 } else {
19112 /* set RX status to 0 because no new message has arrived */
19113 L4_MABX_B.SFunction1_o4_pa = 0.0;
19114 }
19115 }
19116 }
19117
19118 /* End of Outputs for SubSystem: '<S621>/PX2_LaneEdgeLeft' */
19119
19120 /* DataTypeConversion: '<S621>/Data Type Conversion1' */
19121 L4_MABX_B.RX_delta_time_k = L4_MABX_B.SFunction1_o6_p3;
19122
19123 /* DataTypeConversion: '<S621>/Data Type Conversion10' */
19124 L4_MABX_B.RX_delta_time_e = L4_MABX_B.SFunction1_o7_k;
19125
19126 /* DataTypeConversion: '<S621>/Data Type Conversion2' */
19127 L4_MABX_B.RX_status_dj = (L4_MABX_B.SFunction1_o4_pa != 0.0);
19128
19129 /* DataTypeConversion: '<S621>/Data Type Conversion3' */
19130 L4_MABX_B.RX_time_kk = L4_MABX_B.SFunction1_o5_br;
19131
19132 /* Outputs for Enabled SubSystem: '<S621>/PX2_LaneEdgeRight' incorporates:
19133 * EnablePort: '<S623>/Enable'
19134 */
19135 /* Constant: '<S447>/Constant' */
19136 if (L4_MABX_P.Constant_Value_pa) {
19137 /* S-Function (rti_commonblock): '<S623>/S-Function1' */
19138 /* This comment workarounds a code generation problem */
19139
19140 /* dSPACE RTICAN RX Message Block: "PX2_LaneEdgeRight" Id:771 */
19141 {
19142 UInt32 *CAN_Msg;
19143 static dsfloat time_old = 0.0;
19144
19145 /* Read status and timestamp info (previous message) */
19146 if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].timestamp !=
19147 time_old) {
19148 /* ... save timestamp info for the calculation of the RX status
19149 during the consecutive sample hit*/
19150 time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].timestamp;
19151
19152 /* ... set the processed flag to one */
19153 L4_MABX_B.SFunction1_o4_l0 = 1.0;
19154 L4_MABX_B.SFunction1_o5_d = (real_T)
19155 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].timestamp;
19156 L4_MABX_B.SFunction1_o6_o = (real_T)
19157 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].deltatime;
19158 CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x303].data;
19159
19160 /* Decode CAN message */
19161 {
19162 {
19163 rtican_Signal_t CAN_Sgn;
19164
19165 /* ...... "PX2_LaneEdgeRightAngle" (0|16, standard signal, signed int, little endian) */
19166 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
19167 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
19168 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19169 if (CAN_Sgn.SignedSgn >> 15) {
19170 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19171 }
19172
19173 L4_MABX_B.SFunction1_o1_fq = 0.01 * ( ((real_T) CAN_Sgn.SignedSgn) );
19174
19175 /* ...... "PX2_LaneEdgeRightNumPoints" (16|8, standard signal, unsigned int, little endian) */
19176 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
19177 CAN_Sgn.UnsignedSgn &= 0x000000FF;
19178 L4_MABX_B.SFunction1_o2_gp = ((real_T) CAN_Sgn.UnsignedSgn);
19179
19180 /* ...... "PX2_LaneEdgeRightPosition" (24|16, standard signal, signed int, little endian) */
19181 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
19182 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[4];
19183 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19184 if (CAN_Sgn.SignedSgn >> 15) {
19185 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19186 }
19187
19188 L4_MABX_B.SFunction1_o3_j = 0.001 * ( ((real_T) CAN_Sgn.SignedSgn) );
19189 }
19190 }
19191 } else {
19192 /* set RX status to 0 because no new message has arrived */
19193 L4_MABX_B.SFunction1_o4_l0 = 0.0;
19194 }
19195 }
19196 }
19197
19198 /* End of Outputs for SubSystem: '<S621>/PX2_LaneEdgeRight' */
19199
19200 /* DataTypeConversion: '<S621>/Data Type Conversion4' */
19201 L4_MABX_B.RX_delta_time_o1 = L4_MABX_B.SFunction1_o6_o;
19202
19203 /* DataTypeConversion: '<S621>/Data Type Conversion5' */
19204 L4_MABX_B.RX_status_f2 = (L4_MABX_B.SFunction1_o4_l0 != 0.0);
19205
19206 /* DataTypeConversion: '<S621>/Data Type Conversion6' */
19207 L4_MABX_B.RX_time_iv = L4_MABX_B.SFunction1_o5_d;
19208
19209 /* DataTypeConversion: '<S621>/Data Type Conversion8' */
19210 L4_MABX_B.RX_status_i = (L4_MABX_B.SFunction1_o5_h != 0.0);
19211
19212 /* DataTypeConversion: '<S621>/Data Type Conversion9' */
19213 L4_MABX_B.RX_time_hl = L4_MABX_B.SFunction1_o6_pv;
19214
19215 /* Switch: '<S625>/Switch' */
19216 if (L4_MABX_B.If_Then_Else.Switch) {
19217 /* DataTypeConversion: '<S625>/Data Type Conversion8' */
19218 L4_MABX_B.RX_status_pb = (L4_MABX_B.SFunction1_o3_pv != 0.0);
19219 L4_MABX_B.RX_status_dt = L4_MABX_B.RX_status_pb;
19220
19221 /* DataTypeConversion: '<S625>/Data Type Conversion9' */
19222 L4_MABX_B.RX_time_nlr = L4_MABX_B.SFunction1_o4_fz;
19223 L4_MABX_B.RX_time_d = L4_MABX_B.RX_time_nlr;
19224
19225 /* DataTypeConversion: '<S625>/Data Type Conversion10' */
19226 L4_MABX_B.RX_delta_time_cz = L4_MABX_B.SFunction1_o5_i;
19227 L4_MABX_B.RX_delta_time_oc = L4_MABX_B.RX_delta_time_cz;
19228 } else {
19229 /* DataTypeConversion: '<S625>/Data Type Conversion3' */
19230 L4_MABX_B.RX_status_ab = (L4_MABX_B.SFunction1_o3_g4 != 0.0);
19231 L4_MABX_B.RX_status_dt = L4_MABX_B.RX_status_ab;
19232
19233 /* DataTypeConversion: '<S625>/Data Type Conversion2' */
19234 L4_MABX_B.RX_time_j1 = L4_MABX_B.SFunction1_o4_b;
19235 L4_MABX_B.RX_time_d = L4_MABX_B.RX_time_j1;
19236
19237 /* DataTypeConversion: '<S625>/Data Type Conversion1' */
19238 L4_MABX_B.RX_delta_time_o1l = L4_MABX_B.SFunction1_o5_g;
19239 L4_MABX_B.RX_delta_time_oc = L4_MABX_B.RX_delta_time_o1l;
19240 }
19241
19242 /* DataTypeConversion: '<S628>/Data Type Conversion1' */
19243 L4_MABX_B.XPR1ControlStatus = L4_MABX_B.SFunction1_o6_p;
19244
19245 /* DataTypeConversion: '<S628>/Data Type Conversion10' */
19246 L4_MABX_B.RX_delta_time_nb = L4_MABX_B.SFunction1_o13_g;
19247
19248 /* DataTypeConversion: '<S628>/Data Type Conversion2' */
19249 L4_MABX_B.XPR2ControlStatus = L4_MABX_B.SFunction1_o7_av;
19250
19251 /* DataTypeConversion: '<S628>/Data Type Conversion3' */
19252 L4_MABX_B.XPR3ControlStatus = L4_MABX_B.SFunction1_o8_cu;
19253
19254 /* DataTypeConversion: '<S628>/Data Type Conversion8' */
19255 L4_MABX_B.RX_status_je = (L4_MABX_B.SFunction1_o11_j != 0.0);
19256
19257 /* DataTypeConversion: '<S628>/Data Type Conversion9' */
19258 L4_MABX_B.RX_time_hs = L4_MABX_B.SFunction1_o12_g;
19259
19260 /* DataTypeConversion: '<S630>/Data Type Conversion10' */
19261 L4_MABX_B.RX_delta_time_ki = L4_MABX_B.SFunction1_o10_l;
19262
19263 /* DataTypeConversion: '<S630>/Data Type Conversion8' */
19264 L4_MABX_B.RX_status_pm = (L4_MABX_B.SFunction1_o8_lw != 0.0);
19265
19266 /* DataTypeConversion: '<S630>/Data Type Conversion9' */
19267 L4_MABX_B.RX_time_of = L4_MABX_B.SFunction1_o9_m;
19268
19269 /* Outputs for Enabled SubSystem: '<S632>/PX2_MapLaneEgoLeft' incorporates:
19270 * EnablePort: '<S633>/Enable'
19271 */
19272 /* Constant: '<S451>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */
19273 if (L4_MABX_P.CAN_RXEnable_PX2_MapLaneEgoLeft) {
19274 /* S-Function (rti_commonblock): '<S633>/S-Function1' */
19275 /* This comment workarounds a code generation problem */
19276
19277 /* dSPACE RTICAN RX Message Block: "PX2_MapLaneEgoLeft" Id:1542 */
19278 {
19279 UInt32 *CAN_Msg;
19280 static dsfloat time_old = 0.0;
19281
19282 /* Read status and timestamp info (previous message) */
19283 if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].timestamp !=
19284 time_old) {
19285 /* ... save timestamp info for the calculation of the RX status
19286 during the consecutive sample hit*/
19287 time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].timestamp;
19288
19289 /* ... set the processed flag to one */
19290 L4_MABX_B.SFunction1_o7_ah = 1.0;
19291 L4_MABX_B.SFunction1_o8_fp = (real_T)
19292 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].timestamp;
19293 L4_MABX_B.SFunction1_o9_c = (real_T)
19294 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].deltatime;
19295 CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x606].data;
19296
19297 /* Decode CAN message */
19298 {
19299 {
19300 rtican_Signal_t CAN_Sgn;
19301
19302 /* ...... "PX2_MapLaneNearPos" (0|16, standard signal, signed int, little endian) */
19303 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
19304 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
19305 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19306 if (CAN_Sgn.SignedSgn >> 15) {
19307 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19308 }
19309
19310 L4_MABX_B.SFunction1_o1_f = 0.00390625 * ( ((real_T)
19311 CAN_Sgn.SignedSgn) );
19312
19313 /* ...... "PX2_MapLaneMidPos" (16|16, standard signal, signed int, little endian) */
19314 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
19315 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
19316 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19317 if (CAN_Sgn.SignedSgn >> 15) {
19318 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19319 }
19320
19321 L4_MABX_B.SFunction1_o2_ia = 0.00390625 * ( ((real_T)
19322 CAN_Sgn.SignedSgn) );
19323
19324 /* ...... "PX2_MapLaneFarPos" (32|16, standard signal, signed int, little endian) */
19325 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
19326 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
19327 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19328 if (CAN_Sgn.SignedSgn >> 15) {
19329 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19330 }
19331
19332 L4_MABX_B.SFunction1_o3_eu = 0.00390625 * ( ((real_T)
19333 CAN_Sgn.SignedSgn) );
19334
19335 /* ...... "PX2_EgoLaneNearPosValid" (48|2, standard signal, unsigned int, little endian) */
19336 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
19337 CAN_Sgn.UnsignedSgn &= 0x00000003;
19338 L4_MABX_B.SFunction1_o4_fd = ((real_T) CAN_Sgn.UnsignedSgn);
19339
19340 /* ...... "PX2_EgoLaneMidPosValid" (50|2, standard signal, unsigned int, little endian) */
19341 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
19342 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
19343 CAN_Sgn.UnsignedSgn &= 0x00000003;
19344 L4_MABX_B.SFunction1_o5_l = ((real_T) CAN_Sgn.UnsignedSgn);
19345
19346 /* ...... "PX2_EgoLaneFarPosValid" (52|2, standard signal, unsigned int, little endian) */
19347 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
19348 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
19349 CAN_Sgn.UnsignedSgn &= 0x00000003;
19350 L4_MABX_B.SFunction1_o6_ls = ((real_T) CAN_Sgn.UnsignedSgn);
19351 }
19352 }
19353 } else {
19354 /* set RX status to 0 because no new message has arrived */
19355 L4_MABX_B.SFunction1_o7_ah = 0.0;
19356 }
19357 }
19358 }
19359
19360 /* End of Constant: '<S451>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */
19361 /* End of Outputs for SubSystem: '<S632>/PX2_MapLaneEgoLeft' */
19362
19363 /* DataTypeConversion: '<S632>/Data Type Conversion10' */
19364 L4_MABX_B.RX_delta_time_g = L4_MABX_B.SFunction1_o9_c;
19365
19366 /* DataTypeConversion: '<S632>/Data Type Conversion8' */
19367 L4_MABX_B.RX_status_fk = (L4_MABX_B.SFunction1_o7_ah != 0.0);
19368
19369 /* DataTypeConversion: '<S632>/Data Type Conversion9' */
19370 L4_MABX_B.RX_time_ct = L4_MABX_B.SFunction1_o8_fp;
19371
19372 /* Outputs for Enabled SubSystem: '<S634>/PX2_MapLaneEgoRight' incorporates:
19373 * EnablePort: '<S635>/Enable'
19374 */
19375 /* Constant: '<S452>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */
19376 if (L4_MABX_P.CAN_RXEnable_PX2_MapLaneEgoLe_e) {
19377 /* S-Function (rti_commonblock): '<S635>/S-Function1' */
19378 /* This comment workarounds a code generation problem */
19379
19380 /* dSPACE RTICAN RX Message Block: "PX2_MapLaneEgoRight" Id:1541 */
19381 {
19382 UInt32 *CAN_Msg;
19383 static dsfloat time_old = 0.0;
19384
19385 /* Read status and timestamp info (previous message) */
19386 if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].timestamp !=
19387 time_old) {
19388 /* ... save timestamp info for the calculation of the RX status
19389 during the consecutive sample hit*/
19390 time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].timestamp;
19391
19392 /* ... set the processed flag to one */
19393 L4_MABX_B.SFunction1_o7_c0 = 1.0;
19394 L4_MABX_B.SFunction1_o8_l = (real_T)
19395 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].timestamp;
19396 L4_MABX_B.SFunction1_o9_az = (real_T)
19397 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].deltatime;
19398 CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x605].data;
19399
19400 /* Decode CAN message */
19401 {
19402 {
19403 rtican_Signal_t CAN_Sgn;
19404
19405 /* ...... "PX2_MapLaneNearPos" (0|16, standard signal, signed int, little endian) */
19406 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
19407 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
19408 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19409 if (CAN_Sgn.SignedSgn >> 15) {
19410 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19411 }
19412
19413 L4_MABX_B.SFunction1_o1_d = 0.00390625 * ( ((real_T)
19414 CAN_Sgn.SignedSgn) );
19415
19416 /* ...... "PX2_MapLaneMidPos" (16|16, standard signal, signed int, little endian) */
19417 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
19418 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
19419 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19420 if (CAN_Sgn.SignedSgn >> 15) {
19421 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19422 }
19423
19424 L4_MABX_B.SFunction1_o2_jz = 0.00390625 * ( ((real_T)
19425 CAN_Sgn.SignedSgn) );
19426
19427 /* ...... "PX2_MapLaneFarPos" (32|16, standard signal, signed int, little endian) */
19428 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
19429 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
19430 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19431 if (CAN_Sgn.SignedSgn >> 15) {
19432 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19433 }
19434
19435 L4_MABX_B.SFunction1_o3_fv = 0.00390625 * ( ((real_T)
19436 CAN_Sgn.SignedSgn) );
19437
19438 /* ...... "PX2_EgoLaneNearPosValid" (48|2, standard signal, unsigned int, little endian) */
19439 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
19440 CAN_Sgn.UnsignedSgn &= 0x00000003;
19441 L4_MABX_B.SFunction1_o4_mx = ((real_T) CAN_Sgn.UnsignedSgn);
19442
19443 /* ...... "PX2_EgoLaneMidPosValid" (50|2, standard signal, unsigned int, little endian) */
19444 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
19445 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
19446 CAN_Sgn.UnsignedSgn &= 0x00000003;
19447 L4_MABX_B.SFunction1_o5_b = ((real_T) CAN_Sgn.UnsignedSgn);
19448
19449 /* ...... "PX2_EgoLaneFarPosValid" (52|2, standard signal, unsigned int, little endian) */
19450 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
19451 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
19452 CAN_Sgn.UnsignedSgn &= 0x00000003;
19453 L4_MABX_B.SFunction1_o6_l = ((real_T) CAN_Sgn.UnsignedSgn);
19454 }
19455 }
19456 } else {
19457 /* set RX status to 0 because no new message has arrived */
19458 L4_MABX_B.SFunction1_o7_c0 = 0.0;
19459 }
19460 }
19461 }
19462
19463 /* End of Constant: '<S452>/CAN_RX-Enable_PX2_MapLaneEgoLeft' */
19464 /* End of Outputs for SubSystem: '<S634>/PX2_MapLaneEgoRight' */
19465
19466 /* DataTypeConversion: '<S634>/Data Type Conversion10' */
19467 L4_MABX_B.RX_delta_time_ji = L4_MABX_B.SFunction1_o9_az;
19468
19469 /* DataTypeConversion: '<S634>/Data Type Conversion8' */
19470 L4_MABX_B.RX_status_ce = (L4_MABX_B.SFunction1_o7_c0 != 0.0);
19471
19472 /* DataTypeConversion: '<S634>/Data Type Conversion9' */
19473 L4_MABX_B.RX_time_o0 = L4_MABX_B.SFunction1_o8_l;
19474
19475 /* Outputs for Enabled SubSystem: '<S636>/PX2_EgoLanePos' incorporates:
19476 * EnablePort: '<S637>/Enable'
19477 */
19478 /* Constant: '<S453>/Constant' */
19479 if (L4_MABX_P.Constant_Value_j0) {
19480 /* S-Function (rti_commonblock): '<S637>/S-Function1' */
19481 /* This comment workarounds a code generation problem */
19482
19483 /* dSPACE RTICAN RX Message Block: "PX2_EgoLanePos" Id:1540 */
19484 {
19485 UInt32 *CAN_Msg;
19486 static dsfloat time_old = 0.0;
19487
19488 /* Read status and timestamp info (previous message) */
19489 if (can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].timestamp !=
19490 time_old) {
19491 /* ... save timestamp info for the calculation of the RX status
19492 during the consecutive sample hit*/
19493 time_old = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].timestamp;
19494
19495 /* ... set the processed flag to one */
19496 L4_MABX_B.SFunction1_o7_a = 1.0;
19497 L4_MABX_B.SFunction1_o8_d = (real_T)
19498 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].timestamp;
19499 L4_MABX_B.SFunction1_o9_a = (real_T)
19500 can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].deltatime;
19501 CAN_Msg = can_type1_M3_C2_STD[CANTP1_M3_C2_RXSRVC_STD_0x604].data;
19502
19503 /* Decode CAN message */
19504 {
19505 {
19506 rtican_Signal_t CAN_Sgn;
19507
19508 /* ...... "PX2_EgoLaneNearPosErr" (0|16, standard signal, signed int, little endian) */
19509 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
19510 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[1];
19511 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19512 if (CAN_Sgn.SignedSgn >> 15) {
19513 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19514 }
19515
19516 L4_MABX_B.SFunction1_o1_ak = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
19517
19518 /* ...... "PX2_EgoLaneMidPosErr" (16|16, standard signal, signed int, little endian) */
19519 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
19520 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
19521 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19522 if (CAN_Sgn.SignedSgn >> 15) {
19523 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19524 }
19525
19526 L4_MABX_B.SFunction1_o2_m = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
19527
19528 /* ...... "PX2_EgoLaneFarPosErr" (32|16, standard signal, signed int, little endian) */
19529 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
19530 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
19531 CAN_Sgn.SignedSgn &= 0x0000FFFF;
19532 if (CAN_Sgn.SignedSgn >> 15) {
19533 CAN_Sgn.SignedSgn |= 0xFFFF0000;
19534 }
19535
19536 L4_MABX_B.SFunction1_o3_i = 0.1 * ( ((real_T) CAN_Sgn.SignedSgn) );
19537
19538 /* ...... "PX2_EgoLaneNearPosValid" (48|2, standard signal, unsigned int, little endian) */
19539 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
19540 CAN_Sgn.UnsignedSgn &= 0x00000003;
19541 L4_MABX_B.SFunction1_o4_n = ((real_T) CAN_Sgn.UnsignedSgn);
19542
19543 /* ...... "PX2_EgoLaneMidPosValid" (50|2, standard signal, unsigned int, little endian) */
19544 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
19545 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 2;
19546 CAN_Sgn.UnsignedSgn &= 0x00000003;
19547 L4_MABX_B.SFunction1_o5_f3 = ((real_T) CAN_Sgn.UnsignedSgn);
19548
19549 /* ...... "PX2_EgoLaneFarPosValid" (52|2, standard signal, unsigned int, little endian) */
19550 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
19551 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) >> 4;
19552 CAN_Sgn.UnsignedSgn &= 0x00000003;
19553 L4_MABX_B.SFunction1_o6_h = ((real_T) CAN_Sgn.UnsignedSgn);
19554 }
19555 }
19556 } else {
19557 /* set RX status to 0 because no new message has arrived */
19558 L4_MABX_B.SFunction1_o7_a = 0.0;
19559 }
19560 }
19561 }
19562
19563 /* End of Constant: '<S453>/Constant' */
19564 /* End of Outputs for SubSystem: '<S636>/PX2_EgoLanePos' */
19565
19566 /* DataTypeConversion: '<S636>/Data Type Conversion10' */
19567 L4_MABX_B.RX_delta_time_cq = L4_MABX_B.SFunction1_o9_a;
19568
19569 /* DataTypeConversion: '<S636>/Data Type Conversion8' */
19570 L4_MABX_B.RX_status_c4 = (L4_MABX_B.SFunction1_o7_a != 0.0);
19571
19572 /* DataTypeConversion: '<S636>/Data Type Conversion9' */
19573 L4_MABX_B.RX_time_kp = L4_MABX_B.SFunction1_o8_d;
19574
19575 /* DataTypeConversion: '<S638>/Data Type Conversion10' */
19576 L4_MABX_B.RX_delta_time_at = L4_MABX_B.SFunction1_o7_h;
19577
19578 /* DataTypeConversion: '<S638>/Data Type Conversion9' */
19579 L4_MABX_B.RX_time_du = L4_MABX_B.SFunction1_o6_f;
19580
19581 /* DataTypeConversion: '<S640>/Data Type Conversion10' */
19582 L4_MABX_B.RX_delta_time_jg = L4_MABX_B.SFunction1_o28;
19583
19584 /* DataTypeConversion: '<S640>/Data Type Conversion8' */
19585 L4_MABX_B.RX_status_dq = (L4_MABX_B.SFunction1_o26 != 0.0);
19586
19587 /* DataTypeConversion: '<S640>/Data Type Conversion9' */
19588 L4_MABX_B.RX_time_nl = L4_MABX_B.SFunction1_o27;
19589
19590 /* DataTypeConversion: '<S642>/Data Type Conversion10' */
19591 L4_MABX_B.RX_delta_time_i = L4_MABX_B.SFunction1_o10;
19592
19593 /* DataTypeConversion: '<S642>/Data Type Conversion8' */
19594 L4_MABX_B.RX_status_im = (L4_MABX_B.SFunction1_o8_a != 0.0);
19595
19596 /* DataTypeConversion: '<S642>/Data Type Conversion9' */
19597 L4_MABX_B.RX_time_hn = L4_MABX_B.SFunction1_o9_j;
19598
19599 /* DataTypeConversion: '<S644>/Data Type Conversion10' */
19600 L4_MABX_B.RX_delta_time_an = L4_MABX_B.SFunction1_o9;
19601
19602 /* DataTypeConversion: '<S644>/Data Type Conversion8' */
19603 L4_MABX_B.RX_status_hv = (L4_MABX_B.SFunction1_o7_c != 0.0);
19604
19605 /* DataTypeConversion: '<S644>/Data Type Conversion9' */
19606 L4_MABX_B.RX_time_oo = L4_MABX_B.SFunction1_o8_c;
19607
19608 /* Outputs for Enabled SubSystem: '<S646>/VEP1' incorporates:
19609 * EnablePort: '<S647>/Enable'
19610 */
19611 /* Constant: '<S458>/Constant' */
19612 if (L4_MABX_P.Constant_Value_pw > 0.0) {
19613 /* S-Function (rti_commonblock): '<S647>/S-Function1' */
19614 /* This comment workarounds a code generation problem */
19615
19616 /* dSPACE RTICAN RX Message Block: "VEP1" Id:419362563 */
19617 {
19618 UInt32 *CAN_Msg;
19619 static dsfloat time_old = 0.0;
19620
19621 /* Read status and timestamp info (previous message) */
19622 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].timestamp !=
19623 time_old) {
19624 /* ... save timestamp info for the calculation of the RX status
19625 during the consecutive sample hit*/
19626 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].
19627 timestamp;
19628
19629 /* ... set the processed flag to one */
19630 L4_MABX_B.SFunction1_o6 = 1.0;
19631 L4_MABX_B.SFunction1_o7 = (real_T)
19632 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].timestamp;
19633 L4_MABX_B.SFunction1_o8 = (real_T)
19634 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].deltatime;
19635 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FEF703].data;
19636
19637 /* Decode CAN message */
19638 {
19639 {
19640 rtican_Signal_t CAN_Sgn;
19641
19642 /* ...... "NetBatteryCurrent" (0|8, standard signal, unsigned int, little endian) */
19643 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
19644 CAN_Sgn.UnsignedSgn &= 0x000000FF;
19645 L4_MABX_B.SFunction1_o1_ow = -125 + ( ((real_T) CAN_Sgn.UnsignedSgn)
19646 );
19647
19648 /* ...... "AltCurrent" (8|8, standard signal, unsigned int, little endian) */
19649 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
19650 CAN_Sgn.UnsignedSgn &= 0x000000FF;
19651 L4_MABX_B.SFunction1_o2_jj = ((real_T) CAN_Sgn.UnsignedSgn);
19652
19653 /* ...... "ChargingSystemPotential" (16|16, standard signal, unsigned int, little endian) */
19654 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
19655 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[3];
19656 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
19657 L4_MABX_B.SFunction1_o3_at = 0.05 * ( ((real_T) CAN_Sgn.UnsignedSgn)
19658 );
19659
19660 /* ...... "BatteryPotential_PowerInput1" (32|16, standard signal, unsigned int, little endian) */
19661 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
19662 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[5];
19663 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
19664 L4_MABX_B.SFunction1_o4_m2 = 0.05 * ( ((real_T) CAN_Sgn.UnsignedSgn)
19665 );
19666
19667 /* ...... "KeyswitchBatteryPotential" (48|16, standard signal, unsigned int, little endian) */
19668 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
19669 CAN_Sgn.SgnBytes.Byte1 = CAN_Msg[7];
19670 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
19671 L4_MABX_B.SFunction1_o5 = 0.05 * ( ((real_T) CAN_Sgn.UnsignedSgn) );
19672 }
19673 }
19674 } else {
19675 /* set RX status to 0 because no new message has arrived */
19676 L4_MABX_B.SFunction1_o6 = 0.0;
19677 }
19678 }
19679 }
19680
19681 /* End of Constant: '<S458>/Constant' */
19682 /* End of Outputs for SubSystem: '<S646>/VEP1' */
19683
19684 /* DataTypeConversion: '<S646>/Data Type Conversion1' */
19685 L4_MABX_B.PitchAngleExRange_d = L4_MABX_B.SFunction1_o1_ow;
19686
19687 /* DataTypeConversion: '<S646>/Data Type Conversion10' */
19688 L4_MABX_B.RX_delta_time_ln = L4_MABX_B.SFunction1_o8;
19689
19690 /* DataTypeConversion: '<S646>/Data Type Conversion2' */
19691 L4_MABX_B.AltCurrent = L4_MABX_B.SFunction1_o2_jj;
19692
19693 /* DataTypeConversion: '<S646>/Data Type Conversion3' */
19694 L4_MABX_B.ChargingSystemPotential = L4_MABX_B.SFunction1_o3_at;
19695
19696 /* DataTypeConversion: '<S646>/Data Type Conversion4' */
19697 L4_MABX_B.BatteryPotential_PowerInput1 = L4_MABX_B.SFunction1_o4_m2;
19698
19699 /* DataTypeConversion: '<S646>/Data Type Conversion5' */
19700 L4_MABX_B.KeyswitchBatteryPotential = L4_MABX_B.SFunction1_o5;
19701
19702 /* DataTypeConversion: '<S646>/Data Type Conversion8' */
19703 L4_MABX_B.RX_status_n3 = (L4_MABX_B.SFunction1_o6 != 0.0);
19704
19705 /* DataTypeConversion: '<S646>/Data Type Conversion9' */
19706 L4_MABX_B.RX_time_gt = L4_MABX_B.SFunction1_o7;
19707
19708 /* RelationalOperator: '<S649>/Relational Operator2' incorporates:
19709 * Constant: '<S649>/TRUCK_166_VIN_CPV'
19710 */
19711 L4_MABX_B.RelationalOperator2[0] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[0] !=
19712 L4_MABX_B.DataTypeConversion_ld);
19713 L4_MABX_B.RelationalOperator2[1] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[1] !=
19714 L4_MABX_B.DataTypeConversion1_e1);
19715 L4_MABX_B.RelationalOperator2[2] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[2] !=
19716 L4_MABX_B.DataTypeConversion2_oi);
19717 L4_MABX_B.RelationalOperator2[3] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[3] !=
19718 L4_MABX_B.DataTypeConversion3_f);
19719 L4_MABX_B.RelationalOperator2[4] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[4] !=
19720 L4_MABX_B.DataTypeConversion4_j);
19721 L4_MABX_B.RelationalOperator2[5] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[5] !=
19722 L4_MABX_B.DataTypeConversion5_n);
19723 L4_MABX_B.RelationalOperator2[6] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[6] !=
19724 L4_MABX_B.DataTypeConversion6_d4);
19725 L4_MABX_B.RelationalOperator2[7] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[7] !=
19726 L4_MABX_B.DataTypeConversion7_e1);
19727 L4_MABX_B.RelationalOperator2[8] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[8] !=
19728 L4_MABX_B.DataTypeConversion8_fx);
19729 L4_MABX_B.RelationalOperator2[9] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[9] !=
19730 L4_MABX_B.DataTypeConversion9_b);
19731 L4_MABX_B.RelationalOperator2[10] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[10] !=
19732 L4_MABX_B.DataTypeConversion10_l);
19733 L4_MABX_B.RelationalOperator2[11] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[11] !=
19734 L4_MABX_B.DataTypeConversion11_l);
19735 L4_MABX_B.RelationalOperator2[12] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[12] !=
19736 L4_MABX_B.DataTypeConversion12);
19737 L4_MABX_B.RelationalOperator2[13] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[13] !=
19738 L4_MABX_B.DataTypeConversion14_f);
19739 L4_MABX_B.RelationalOperator2[14] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[14] !=
19740 L4_MABX_B.DataTypeConversion13_n);
19741 L4_MABX_B.RelationalOperator2[15] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[15] !=
19742 L4_MABX_B.DataTypeConversion15_a);
19743 L4_MABX_B.RelationalOperator2[16] = (L4_MABX_P.TRUCK_166_VIN_CPV_Value[16] !=
19744 L4_MABX_B.DataTypeConversion16_e);
19745
19746 /* Sum: '<S649>/Add1' */
19747 tmp = 0U;
19748 for (i = 0; i < 17; i++) {
19749 tmp += L4_MABX_B.RelationalOperator2[i];
19750 }
19751
19752 L4_MABX_B.Add1_d = (uint8_T)tmp;
19753
19754 /* End of Sum: '<S649>/Add1' */
19755
19756 /* RelationalOperator: '<S654>/Compare' incorporates:
19757 * Constant: '<S654>/Constant'
19758 */
19759 L4_MABX_B.Compare_h = (L4_MABX_B.Add1_d == L4_MABX_P.Constant_Value_m0);
19760
19761 /* UnitDelay: '<S649>/Unit_Delay2' */
19762 L4_MABX_B.Unit_Delay2_l3 = L4_MABX_DW.Unit_Delay2_DSTATE_k;
19763
19764 /* Logic: '<S649>/Logical Operator1' */
19765 L4_MABX_B.LogicalOperator1_j = (L4_MABX_B.Unit_Delay2_l3 &&
19766 L4_MABX_B.Compare_h);
19767
19768 /* Logic: '<S655>/Logical Operator2' */
19769 L4_MABX_B.LogicalOperator2_h = !L4_MABX_B.LogicalOperator1_c;
19770
19771 /* UnitDelay: '<S649>/Unit_Delay1' */
19772 L4_MABX_B.Unit_Delay1_g = L4_MABX_DW.Unit_Delay1_DSTATE_p;
19773
19774 /* Logic: '<S656>/Logical Operator3' */
19775 L4_MABX_B.LogicalOperator3_cs = !L4_MABX_B.Unit_Delay1_g;
19776
19777 /* UnitDelay: '<S656>/Unit_Delay' */
19778 L4_MABX_B.Unit_Delay_fs = L4_MABX_DW.Unit_Delay_DSTATE_g1;
19779
19780 /* Logic: '<S656>/Logical Operator' */
19781 L4_MABX_B.LogicalOperator_f2 = (L4_MABX_B.LogicalOperator3_cs &&
19782 L4_MABX_B.Unit_Delay_fs);
19783
19784 /* Logic: '<S656>/Logical Operator1' */
19785 L4_MABX_B.LogicalOperator1_e = (L4_MABX_B.LogicalOperator1_j ||
19786 L4_MABX_B.LogicalOperator_f2);
19787
19788 /* Logic: '<S656>/Logical Operator2' */
19789 L4_MABX_B.LogicalOperator2_f = !L4_MABX_B.LogicalOperator1_e;
19790
19791 /* Constant: '<S415>/Constant2' */
19792 L4_MABX_B.PX2_HeartBeat = L4_MABX_P.Constant2_Value_l;
19793
19794 /* RelationalOperator: '<S693>/Operator' incorporates:
19795 * Constant: '<S469>/Constant1'
19796 */
19797 L4_MABX_B.Operator_la = (L4_MABX_B.DataTypeConversion_kl[0] ==
19798 L4_MABX_P.Constant1_Value_ap);
19799
19800 /* Outputs for Enabled SubSystem: '<S469>/Decode_TPCM_CTS' incorporates:
19801 * EnablePort: '<S688>/Enable'
19802 */
19803 if (L4_MABX_B.Operator_la) {
19804 /* SignalConversion: '<S705>/Signal Conversion' */
19805 L4_MABX_B.SPN2556_ControlByte_d = L4_MABX_B.DataTypeConversion_kl[0];
19806
19807 /* SignalConversion: '<S706>/Signal Conversion' */
19808 L4_MABX_B.SPN2561_NumberOfPacketsThatCanB = L4_MABX_B.DataTypeConversion_kl
19809 [1];
19810
19811 /* SignalConversion: '<S707>/Signal Conversion' */
19812 L4_MABX_B.SPN2562_NextPacketNumberToBeSen = L4_MABX_B.DataTypeConversion_kl
19813 [2];
19814
19815 /* DataTypeConversion: '<S708>/Data Type Conversion' */
19816 L4_MABX_B.DataTypeConversion_bs = L4_MABX_B.DataTypeConversion_kl[5];
19817
19818 /* DataTypeConversion: '<S708>/Data Type Conversion1' */
19819 L4_MABX_B.DataTypeConversion1_h3 = L4_MABX_B.DataTypeConversion_kl[6];
19820
19821 /* DataTypeConversion: '<S708>/Data Type Conversion2' */
19822 L4_MABX_B.DataTypeConversion2_ii = L4_MABX_B.DataTypeConversion_kl[7];
19823
19824 /* ArithShift: '<S708>/Shift Arithmetic1' */
19825 L4_MABX_B.ShiftArithmetic1_f = L4_MABX_B.DataTypeConversion1_h3 << 8;
19826
19827 /* ArithShift: '<S708>/Shift Arithmetic2' */
19828 L4_MABX_B.ShiftArithmetic2_j = L4_MABX_B.DataTypeConversion2_ii << 16;
19829
19830 /* S-Function (sfix_bitop): '<S709>/Operator' */
19831 L4_MABX_B.Operator_i = L4_MABX_B.DataTypeConversion_bs |
19832 L4_MABX_B.ShiftArithmetic1_f | L4_MABX_B.ShiftArithmetic2_j;
19833
19834 /* DataTypeConversion: '<S709>/DataType' */
19835 L4_MABX_B.DataType_il = L4_MABX_B.Operator_i;
19836 }
19837
19838 /* End of Outputs for SubSystem: '<S469>/Decode_TPCM_CTS' */
19839
19840 /* RelationalOperator: '<S696>/Operator' incorporates:
19841 * Constant: '<S469>/Constant4'
19842 */
19843 L4_MABX_B.Operator_b1 = (L4_MABX_B.DataTypeConversion_kl[0] ==
19844 L4_MABX_P.Constant4_Value_h);
19845
19846 /* Outputs for Enabled SubSystem: '<S469>/Decode_TPCM_ConnectionAbort' incorporates:
19847 * EnablePort: '<S689>/Enable'
19848 */
19849 if (L4_MABX_B.Operator_b1) {
19850 /* SignalConversion: '<S711>/Signal Conversion' */
19851 L4_MABX_B.SPN2556_ControlByte_n = L4_MABX_B.DataTypeConversion_kl[0];
19852
19853 /* SignalConversion: '<S712>/Signal Conversion' */
19854 L4_MABX_B.SPN2570_ConnectionAbortReason = L4_MABX_B.DataTypeConversion_kl[1];
19855
19856 /* DataTypeConversion: '<S713>/Data Type Conversion' */
19857 L4_MABX_B.DataTypeConversion_g1 = L4_MABX_B.DataTypeConversion_kl[5];
19858
19859 /* DataTypeConversion: '<S713>/Data Type Conversion1' */
19860 L4_MABX_B.DataTypeConversion1_eh = L4_MABX_B.DataTypeConversion_kl[6];
19861
19862 /* DataTypeConversion: '<S713>/Data Type Conversion2' */
19863 L4_MABX_B.DataTypeConversion2_ia = L4_MABX_B.DataTypeConversion_kl[7];
19864
19865 /* ArithShift: '<S713>/Shift Arithmetic1' */
19866 L4_MABX_B.ShiftArithmetic1_h = L4_MABX_B.DataTypeConversion1_eh << 8;
19867
19868 /* ArithShift: '<S713>/Shift Arithmetic2' */
19869 L4_MABX_B.ShiftArithmetic2_m = L4_MABX_B.DataTypeConversion2_ia << 16;
19870
19871 /* S-Function (sfix_bitop): '<S714>/Operator' */
19872 L4_MABX_B.Operator_cc = L4_MABX_B.DataTypeConversion_g1 |
19873 L4_MABX_B.ShiftArithmetic1_h | L4_MABX_B.ShiftArithmetic2_m;
19874
19875 /* DataTypeConversion: '<S714>/DataType' */
19876 L4_MABX_B.DataType_hm = L4_MABX_B.Operator_cc;
19877 }
19878
19879 /* End of Outputs for SubSystem: '<S469>/Decode_TPCM_ConnectionAbort' */
19880
19881 /* RelationalOperator: '<S694>/Operator' incorporates:
19882 * Constant: '<S469>/Constant2'
19883 */
19884 L4_MABX_B.Operator_pg = (L4_MABX_B.DataTypeConversion_kl[0] ==
19885 L4_MABX_P.Constant2_Value_bx);
19886
19887 /* Outputs for Enabled SubSystem: '<S469>/Decode_TPCM_EndOfMessageAck' incorporates:
19888 * EnablePort: '<S690>/Enable'
19889 */
19890 if (L4_MABX_B.Operator_pg) {
19891 /* SignalConversion: '<S716>/Signal Conversion' */
19892 L4_MABX_B.SPN2556_ControlByte_o = L4_MABX_B.DataTypeConversion_kl[0];
19893
19894 /* DataTypeConversion: '<S717>/Data Type Conversion' */
19895 L4_MABX_B.DataTypeConversion_gm = L4_MABX_B.DataTypeConversion_kl[1];
19896
19897 /* DataTypeConversion: '<S717>/Data Type Conversion1' */
19898 L4_MABX_B.DataTypeConversion1_df = L4_MABX_B.DataTypeConversion_kl[2];
19899
19900 /* ArithShift: '<S717>/Shift Arithmetic2' */
19901 L4_MABX_B.ShiftArithmetic2_f = (uint16_T)(L4_MABX_B.DataTypeConversion1_df <<
19902 8);
19903
19904 /* S-Function (sfix_bitop): '<S720>/Operator' */
19905 L4_MABX_B.Operator_nv = (uint16_T)(L4_MABX_B.DataTypeConversion_gm |
19906 L4_MABX_B.ShiftArithmetic2_f);
19907
19908 /* DataTypeConversion: '<S720>/DataType' */
19909 L4_MABX_B.DataType_cp = L4_MABX_B.Operator_nv;
19910
19911 /* SignalConversion: '<S718>/Signal Conversion' */
19912 L4_MABX_B.SPN2565_TotalNumberOfPackets = L4_MABX_B.DataTypeConversion_kl[3];
19913
19914 /* DataTypeConversion: '<S719>/Data Type Conversion' */
19915 L4_MABX_B.DataTypeConversion_id = L4_MABX_B.DataTypeConversion_kl[5];
19916
19917 /* DataTypeConversion: '<S719>/Data Type Conversion1' */
19918 L4_MABX_B.DataTypeConversion1_ii = L4_MABX_B.DataTypeConversion_kl[6];
19919
19920 /* DataTypeConversion: '<S719>/Data Type Conversion2' */
19921 L4_MABX_B.DataTypeConversion2_av = L4_MABX_B.DataTypeConversion_kl[7];
19922
19923 /* ArithShift: '<S719>/Shift Arithmetic1' */
19924 L4_MABX_B.ShiftArithmetic1_p = L4_MABX_B.DataTypeConversion1_ii << 8;
19925
19926 /* ArithShift: '<S719>/Shift Arithmetic2' */
19927 L4_MABX_B.ShiftArithmetic2_l = L4_MABX_B.DataTypeConversion2_av << 16;
19928
19929 /* S-Function (sfix_bitop): '<S721>/Operator' */
19930 L4_MABX_B.Operator_hr = L4_MABX_B.DataTypeConversion_id |
19931 L4_MABX_B.ShiftArithmetic1_p | L4_MABX_B.ShiftArithmetic2_l;
19932
19933 /* DataTypeConversion: '<S721>/DataType' */
19934 L4_MABX_B.DataType_ns = L4_MABX_B.Operator_hr;
19935 }
19936
19937 /* End of Outputs for SubSystem: '<S469>/Decode_TPCM_EndOfMessageAck' */
19938
19939 /* RelationalOperator: '<S692>/Operator' incorporates:
19940 * Constant: '<S469>/Constant'
19941 */
19942 L4_MABX_B.Operator_ay = (L4_MABX_B.DataTypeConversion_kl[0] ==
19943 L4_MABX_P.Constant_Value_en);
19944
19945 /* Outputs for Enabled SubSystem: '<S469>/Decode_TPCM_RTS' incorporates:
19946 * EnablePort: '<S691>/Enable'
19947 */
19948 if (L4_MABX_B.Operator_ay) {
19949 /* SignalConversion: '<S723>/Signal Conversion' */
19950 L4_MABX_B.SPN2556_ControlByte = L4_MABX_B.DataTypeConversion_kl[0];
19951
19952 /* DataTypeConversion: '<S724>/Data Type Conversion' */
19953 L4_MABX_B.DataTypeConversion_gi = L4_MABX_B.DataTypeConversion_kl[1];
19954
19955 /* DataTypeConversion: '<S724>/Data Type Conversion1' */
19956 L4_MABX_B.DataTypeConversion1_it = L4_MABX_B.DataTypeConversion_kl[2];
19957
19958 /* ArithShift: '<S724>/Shift Arithmetic2' */
19959 L4_MABX_B.ShiftArithmetic2_a = (uint16_T)(L4_MABX_B.DataTypeConversion1_it <<
19960 8);
19961
19962 /* S-Function (sfix_bitop): '<S728>/Operator' */
19963 L4_MABX_B.Operator_nj = (uint16_T)(L4_MABX_B.DataTypeConversion_gi |
19964 L4_MABX_B.ShiftArithmetic2_a);
19965
19966 /* DataTypeConversion: '<S728>/DataType' */
19967 L4_MABX_B.DataType_cn = L4_MABX_B.Operator_nj;
19968
19969 /* SignalConversion: '<S725>/Signal Conversion' */
19970 L4_MABX_B.SPN2558_TotalNumberOfPackets = L4_MABX_B.DataTypeConversion_kl[3];
19971
19972 /* SignalConversion: '<S726>/Signal Conversion' */
19973 L4_MABX_B.SPN2559_MaximumNumberOfPackets = L4_MABX_B.DataTypeConversion_kl[4];
19974
19975 /* DataTypeConversion: '<S727>/Data Type Conversion' */
19976 L4_MABX_B.DataTypeConversion_ge = L4_MABX_B.DataTypeConversion_kl[5];
19977
19978 /* DataTypeConversion: '<S727>/Data Type Conversion1' */
19979 L4_MABX_B.DataTypeConversion1_lh = L4_MABX_B.DataTypeConversion_kl[6];
19980
19981 /* DataTypeConversion: '<S727>/Data Type Conversion2' */
19982 L4_MABX_B.DataTypeConversion2_h = L4_MABX_B.DataTypeConversion_kl[7];
19983
19984 /* ArithShift: '<S727>/Shift Arithmetic1' */
19985 L4_MABX_B.ShiftArithmetic1 = L4_MABX_B.DataTypeConversion1_lh << 8;
19986
19987 /* ArithShift: '<S727>/Shift Arithmetic2' */
19988 L4_MABX_B.ShiftArithmetic2 = L4_MABX_B.DataTypeConversion2_h << 16;
19989
19990 /* S-Function (sfix_bitop): '<S729>/Operator' */
19991 L4_MABX_B.Operator_ng = L4_MABX_B.DataTypeConversion_ge |
19992 L4_MABX_B.ShiftArithmetic1 | L4_MABX_B.ShiftArithmetic2;
19993
19994 /* DataTypeConversion: '<S729>/DataType' */
19995 L4_MABX_B.DataType_iz = L4_MABX_B.Operator_ng;
19996 }
19997
19998 /* End of Outputs for SubSystem: '<S469>/Decode_TPCM_RTS' */
19999
20000 /* RelationalOperator: '<S589>/Operator' incorporates:
20001 * Constant: '<S444>/Constant'
20002 * Constant: '<S585>/Constant'
20003 */
20004 L4_MABX_B.Operator_ep = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant_Value_ih);
20005
20006 /* Outputs for Enabled SubSystem: '<S582>/CAN_TYPE1_RX_M1_C1' incorporates:
20007 * EnablePort: '<S586>/Enable'
20008 */
20009 if (L4_MABX_B.Operator_ep) {
20010 /* S-Function (rti_commonblock): '<S586>/S-Function1' */
20011 /* This comment workarounds a code generation problem */
20012
20013 /* dSPACE RTICAN RX Message Block: "PropB_REAX_3_13" Id:419426579 */
20014 {
20015 UInt32 *CAN_Msg;
20016 static dsfloat time_old = 0.0;
20017
20018 /* Read status and timestamp info (previous message) */
20019 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].timestamp !=
20020 time_old) {
20021 /* ... save timestamp info for the calculation of the RX status
20022 during the consecutive sample hit*/
20023 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].
20024 timestamp;
20025
20026 /* ... set the processed flag to one */
20027 L4_MABX_B.SFunction1_o9_le = 1.0;
20028 L4_MABX_B.SFunction1_o10_m = (real_T)
20029 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].timestamp;
20030 L4_MABX_B.SFunction1_o11_h = (real_T)
20031 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].deltatime;
20032 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF113].data;
20033
20034 /* Decode CAN message */
20035 {
20036 {
20037 rtican_Signal_t CAN_Sgn;
20038
20039 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
20040 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
20041 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20042 L4_MABX_B.SFunction1_o1_ajb = ((real_T) CAN_Sgn.UnsignedSgn);
20043
20044 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
20045 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
20046 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20047 L4_MABX_B.SFunction1_o2_ej = ((real_T) CAN_Sgn.UnsignedSgn);
20048
20049 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
20050 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
20051 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20052 L4_MABX_B.SFunction1_o3_as = ((real_T) CAN_Sgn.UnsignedSgn);
20053
20054 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
20055 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
20056 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20057 L4_MABX_B.SFunction1_o4_it = ((real_T) CAN_Sgn.UnsignedSgn);
20058
20059 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
20060 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
20061 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20062 L4_MABX_B.SFunction1_o5_a = ((real_T) CAN_Sgn.UnsignedSgn);
20063
20064 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
20065 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
20066 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20067 L4_MABX_B.SFunction1_o6_gn = ((real_T) CAN_Sgn.UnsignedSgn);
20068
20069 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
20070 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
20071 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20072 L4_MABX_B.SFunction1_o7_ad = ((real_T) CAN_Sgn.UnsignedSgn);
20073
20074 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
20075 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
20076 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20077 L4_MABX_B.SFunction1_o8_pl = ((real_T) CAN_Sgn.UnsignedSgn);
20078 }
20079 }
20080 } else {
20081 /* set RX status to 0 because no new message has arrived */
20082 L4_MABX_B.SFunction1_o9_le = 0.0;
20083 }
20084 }
20085 }
20086
20087 /* End of Outputs for SubSystem: '<S582>/CAN_TYPE1_RX_M1_C1' */
20088
20089 /* RelationalOperator: '<S590>/Operator' incorporates:
20090 * Constant: '<S444>/Constant'
20091 * Constant: '<S585>/Constant1'
20092 */
20093 L4_MABX_B.Operator_ct = (PROPB_REAX_CHANNEL_APV ==
20094 L4_MABX_P.Constant1_Value_jg);
20095
20096 /* Outputs for Enabled SubSystem: '<S583>/CAN_TYPE1_RX_M1_C2' incorporates:
20097 * EnablePort: '<S587>/Enable'
20098 */
20099 if (L4_MABX_B.Operator_ct) {
20100 /* S-Function (rti_commonblock): '<S587>/S-Function1' */
20101 /* This comment workarounds a code generation problem */
20102
20103 /* dSPACE RTICAN RX Message Block: "PropB_REAX_3_13" Id:419426579 */
20104 {
20105 UInt32 *CAN_Msg;
20106 static dsfloat time_old = 0.0;
20107
20108 /* Read status and timestamp info (previous message) */
20109 if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].timestamp !=
20110 time_old) {
20111 /* ... save timestamp info for the calculation of the RX status
20112 during the consecutive sample hit*/
20113 time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].
20114 timestamp;
20115
20116 /* ... set the processed flag to one */
20117 L4_MABX_B.SFunction1_o9_mi = 1.0;
20118 L4_MABX_B.SFunction1_o10_g = (real_T)
20119 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].timestamp;
20120 L4_MABX_B.SFunction1_o11_f = (real_T)
20121 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].deltatime;
20122 CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF113].data;
20123
20124 /* Decode CAN message */
20125 {
20126 {
20127 rtican_Signal_t CAN_Sgn;
20128
20129 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
20130 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
20131 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20132 L4_MABX_B.SFunction1_o1_koq = ((real_T) CAN_Sgn.UnsignedSgn);
20133
20134 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
20135 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
20136 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20137 L4_MABX_B.SFunction1_o2_e = ((real_T) CAN_Sgn.UnsignedSgn);
20138
20139 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
20140 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
20141 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20142 L4_MABX_B.SFunction1_o3_ab = ((real_T) CAN_Sgn.UnsignedSgn);
20143
20144 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
20145 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
20146 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20147 L4_MABX_B.SFunction1_o4_ej = ((real_T) CAN_Sgn.UnsignedSgn);
20148
20149 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
20150 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
20151 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20152 L4_MABX_B.SFunction1_o5_n = ((real_T) CAN_Sgn.UnsignedSgn);
20153
20154 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
20155 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
20156 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20157 L4_MABX_B.SFunction1_o6_nf = ((real_T) CAN_Sgn.UnsignedSgn);
20158
20159 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
20160 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
20161 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20162 L4_MABX_B.SFunction1_o7_m = ((real_T) CAN_Sgn.UnsignedSgn);
20163
20164 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
20165 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
20166 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20167 L4_MABX_B.SFunction1_o8_o = ((real_T) CAN_Sgn.UnsignedSgn);
20168 }
20169 }
20170 } else {
20171 /* set RX status to 0 because no new message has arrived */
20172 L4_MABX_B.SFunction1_o9_mi = 0.0;
20173 }
20174 }
20175 }
20176
20177 /* End of Outputs for SubSystem: '<S583>/CAN_TYPE1_RX_M1_C2' */
20178
20179 /* DataTypeConversion: '<S583>/Data Type Conversion' */
20180 PositionFinalLimited = L4_MABX_B.SFunction1_o1_koq;
20181 if (PositionFinalLimited < 256.0) {
20182 if (PositionFinalLimited >= 0.0) {
20183 starting_index = (uint8_T)PositionFinalLimited;
20184 } else {
20185 starting_index = 0U;
20186 }
20187 } else {
20188 starting_index = MAX_uint8_T;
20189 }
20190
20191 L4_MABX_B.DataTypeConversion_mo = starting_index;
20192
20193 /* End of DataTypeConversion: '<S583>/Data Type Conversion' */
20194
20195 /* DataTypeConversion: '<S583>/Data Type Conversion1' */
20196 PositionFinalLimited = L4_MABX_B.SFunction1_o2_e;
20197 if (PositionFinalLimited < 256.0) {
20198 if (PositionFinalLimited >= 0.0) {
20199 starting_index = (uint8_T)PositionFinalLimited;
20200 } else {
20201 starting_index = 0U;
20202 }
20203 } else {
20204 starting_index = MAX_uint8_T;
20205 }
20206
20207 L4_MABX_B.DataTypeConversion1_fk = starting_index;
20208
20209 /* End of DataTypeConversion: '<S583>/Data Type Conversion1' */
20210
20211 /* DataTypeConversion: '<S583>/Data Type Conversion2' */
20212 PositionFinalLimited = L4_MABX_B.SFunction1_o3_ab;
20213 if (PositionFinalLimited < 256.0) {
20214 if (PositionFinalLimited >= 0.0) {
20215 starting_index = (uint8_T)PositionFinalLimited;
20216 } else {
20217 starting_index = 0U;
20218 }
20219 } else {
20220 starting_index = MAX_uint8_T;
20221 }
20222
20223 L4_MABX_B.DataTypeConversion2_jx = starting_index;
20224
20225 /* End of DataTypeConversion: '<S583>/Data Type Conversion2' */
20226
20227 /* DataTypeConversion: '<S583>/Data Type Conversion3' */
20228 PositionFinalLimited = L4_MABX_B.SFunction1_o4_ej;
20229 if (PositionFinalLimited < 256.0) {
20230 if (PositionFinalLimited >= 0.0) {
20231 starting_index = (uint8_T)PositionFinalLimited;
20232 } else {
20233 starting_index = 0U;
20234 }
20235 } else {
20236 starting_index = MAX_uint8_T;
20237 }
20238
20239 L4_MABX_B.DataTypeConversion3_c = starting_index;
20240
20241 /* End of DataTypeConversion: '<S583>/Data Type Conversion3' */
20242
20243 /* DataTypeConversion: '<S583>/Data Type Conversion4' */
20244 PositionFinalLimited = L4_MABX_B.SFunction1_o5_n;
20245 if (PositionFinalLimited < 256.0) {
20246 if (PositionFinalLimited >= 0.0) {
20247 starting_index = (uint8_T)PositionFinalLimited;
20248 } else {
20249 starting_index = 0U;
20250 }
20251 } else {
20252 starting_index = MAX_uint8_T;
20253 }
20254
20255 L4_MABX_B.DataTypeConversion4_ms = starting_index;
20256
20257 /* End of DataTypeConversion: '<S583>/Data Type Conversion4' */
20258
20259 /* DataTypeConversion: '<S583>/Data Type Conversion5' */
20260 PositionFinalLimited = L4_MABX_B.SFunction1_o6_nf;
20261 if (PositionFinalLimited < 256.0) {
20262 if (PositionFinalLimited >= 0.0) {
20263 starting_index = (uint8_T)PositionFinalLimited;
20264 } else {
20265 starting_index = 0U;
20266 }
20267 } else {
20268 starting_index = MAX_uint8_T;
20269 }
20270
20271 L4_MABX_B.DataTypeConversion5_p = starting_index;
20272
20273 /* End of DataTypeConversion: '<S583>/Data Type Conversion5' */
20274
20275 /* DataTypeConversion: '<S583>/Data Type Conversion6' */
20276 PositionFinalLimited = L4_MABX_B.SFunction1_o7_m;
20277 if (PositionFinalLimited < 256.0) {
20278 if (PositionFinalLimited >= 0.0) {
20279 starting_index = (uint8_T)PositionFinalLimited;
20280 } else {
20281 starting_index = 0U;
20282 }
20283 } else {
20284 starting_index = MAX_uint8_T;
20285 }
20286
20287 L4_MABX_B.DataTypeConversion6_e3 = starting_index;
20288
20289 /* End of DataTypeConversion: '<S583>/Data Type Conversion6' */
20290
20291 /* DataTypeConversion: '<S583>/Data Type Conversion7' */
20292 PositionFinalLimited = L4_MABX_B.SFunction1_o8_o;
20293 if (PositionFinalLimited < 256.0) {
20294 if (PositionFinalLimited >= 0.0) {
20295 starting_index = (uint8_T)PositionFinalLimited;
20296 } else {
20297 starting_index = 0U;
20298 }
20299 } else {
20300 starting_index = MAX_uint8_T;
20301 }
20302
20303 L4_MABX_B.DataTypeConversion7_a = starting_index;
20304
20305 /* End of DataTypeConversion: '<S583>/Data Type Conversion7' */
20306
20307 /* RelationalOperator: '<S594>/Operator' incorporates:
20308 * Constant: '<S444>/Constant'
20309 * Constant: '<S585>/Constant5'
20310 */
20311 L4_MABX_B.Operator_ki = (PROPB_REAX_CHANNEL_APV ==
20312 L4_MABX_P.Constant5_Value_ku);
20313
20314 /* Outputs for Enabled SubSystem: '<S584>/CAN_TYPE1_RX_M3_C2' incorporates:
20315 * EnablePort: '<S588>/Enable'
20316 */
20317 if (L4_MABX_B.Operator_ki) {
20318 /* S-Function (rti_commonblock): '<S588>/S-Function1' */
20319 /* This comment workarounds a code generation problem */
20320
20321 /* dSPACE RTICAN RX Message Block: "PropB_REAX_3_13" Id:486535443 */
20322 {
20323 UInt32 *CAN_Msg;
20324 static dsfloat time_old = 0.0;
20325
20326 /* Read status and timestamp info (previous message) */
20327 if (can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].timestamp !=
20328 time_old) {
20329 /* ... save timestamp info for the calculation of the RX status
20330 during the consecutive sample hit*/
20331 time_old = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].
20332 timestamp;
20333
20334 /* ... set the processed flag to one */
20335 L4_MABX_B.SFunction1_o9_l = 1.0;
20336 L4_MABX_B.SFunction1_o10_c = (real_T)
20337 can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].timestamp;
20338 L4_MABX_B.SFunction1_o11_l = (real_T)
20339 can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].deltatime;
20340 CAN_Msg = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF113].data;
20341
20342 /* Decode CAN message */
20343 {
20344 {
20345 rtican_Signal_t CAN_Sgn;
20346
20347 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
20348 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
20349 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20350 L4_MABX_B.SFunction1_o1_fo = ((real_T) CAN_Sgn.UnsignedSgn);
20351
20352 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
20353 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
20354 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20355 L4_MABX_B.SFunction1_o2_mv = ((real_T) CAN_Sgn.UnsignedSgn);
20356
20357 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
20358 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
20359 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20360 L4_MABX_B.SFunction1_o3_j5 = ((real_T) CAN_Sgn.UnsignedSgn);
20361
20362 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
20363 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
20364 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20365 L4_MABX_B.SFunction1_o4_n0 = ((real_T) CAN_Sgn.UnsignedSgn);
20366
20367 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
20368 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
20369 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20370 L4_MABX_B.SFunction1_o5_ov = ((real_T) CAN_Sgn.UnsignedSgn);
20371
20372 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
20373 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
20374 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20375 L4_MABX_B.SFunction1_o6_g = ((real_T) CAN_Sgn.UnsignedSgn);
20376
20377 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
20378 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
20379 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20380 L4_MABX_B.SFunction1_o7_ou = ((real_T) CAN_Sgn.UnsignedSgn);
20381
20382 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
20383 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
20384 CAN_Sgn.UnsignedSgn &= 0x000000FF;
20385 L4_MABX_B.SFunction1_o8_m0 = ((real_T) CAN_Sgn.UnsignedSgn);
20386 }
20387 }
20388 } else {
20389 /* set RX status to 0 because no new message has arrived */
20390 L4_MABX_B.SFunction1_o9_l = 0.0;
20391 }
20392 }
20393 }
20394
20395 /* End of Outputs for SubSystem: '<S584>/CAN_TYPE1_RX_M3_C2' */
20396
20397 /* DataTypeConversion: '<S584>/Data Type Conversion' */
20398 PositionFinalLimited = L4_MABX_B.SFunction1_o1_fo;
20399 if (PositionFinalLimited < 256.0) {
20400 if (PositionFinalLimited >= 0.0) {
20401 starting_index = (uint8_T)PositionFinalLimited;
20402 } else {
20403 starting_index = 0U;
20404 }
20405 } else {
20406 starting_index = MAX_uint8_T;
20407 }
20408
20409 L4_MABX_B.DataTypeConversion_mx = starting_index;
20410
20411 /* End of DataTypeConversion: '<S584>/Data Type Conversion' */
20412
20413 /* DataTypeConversion: '<S584>/Data Type Conversion1' */
20414 PositionFinalLimited = L4_MABX_B.SFunction1_o2_mv;
20415 if (PositionFinalLimited < 256.0) {
20416 if (PositionFinalLimited >= 0.0) {
20417 starting_index = (uint8_T)PositionFinalLimited;
20418 } else {
20419 starting_index = 0U;
20420 }
20421 } else {
20422 starting_index = MAX_uint8_T;
20423 }
20424
20425 L4_MABX_B.DataTypeConversion1_jb = starting_index;
20426
20427 /* End of DataTypeConversion: '<S584>/Data Type Conversion1' */
20428
20429 /* DataTypeConversion: '<S584>/Data Type Conversion2' */
20430 PositionFinalLimited = L4_MABX_B.SFunction1_o3_j5;
20431 if (PositionFinalLimited < 256.0) {
20432 if (PositionFinalLimited >= 0.0) {
20433 starting_index = (uint8_T)PositionFinalLimited;
20434 } else {
20435 starting_index = 0U;
20436 }
20437 } else {
20438 starting_index = MAX_uint8_T;
20439 }
20440
20441 L4_MABX_B.DataTypeConversion2_hg = starting_index;
20442
20443 /* End of DataTypeConversion: '<S584>/Data Type Conversion2' */
20444
20445 /* DataTypeConversion: '<S584>/Data Type Conversion3' */
20446 PositionFinalLimited = L4_MABX_B.SFunction1_o4_n0;
20447 if (PositionFinalLimited < 256.0) {
20448 if (PositionFinalLimited >= 0.0) {
20449 starting_index = (uint8_T)PositionFinalLimited;
20450 } else {
20451 starting_index = 0U;
20452 }
20453 } else {
20454 starting_index = MAX_uint8_T;
20455 }
20456
20457 L4_MABX_B.DataTypeConversion3_km = starting_index;
20458
20459 /* End of DataTypeConversion: '<S584>/Data Type Conversion3' */
20460
20461 /* DataTypeConversion: '<S584>/Data Type Conversion4' */
20462 PositionFinalLimited = L4_MABX_B.SFunction1_o5_ov;
20463 if (PositionFinalLimited < 256.0) {
20464 if (PositionFinalLimited >= 0.0) {
20465 starting_index = (uint8_T)PositionFinalLimited;
20466 } else {
20467 starting_index = 0U;
20468 }
20469 } else {
20470 starting_index = MAX_uint8_T;
20471 }
20472
20473 L4_MABX_B.DataTypeConversion4_e = starting_index;
20474
20475 /* End of DataTypeConversion: '<S584>/Data Type Conversion4' */
20476
20477 /* DataTypeConversion: '<S584>/Data Type Conversion5' */
20478 PositionFinalLimited = L4_MABX_B.SFunction1_o6_g;
20479 if (PositionFinalLimited < 256.0) {
20480 if (PositionFinalLimited >= 0.0) {
20481 starting_index = (uint8_T)PositionFinalLimited;
20482 } else {
20483 starting_index = 0U;
20484 }
20485 } else {
20486 starting_index = MAX_uint8_T;
20487 }
20488
20489 L4_MABX_B.DataTypeConversion5_m = starting_index;
20490
20491 /* End of DataTypeConversion: '<S584>/Data Type Conversion5' */
20492
20493 /* DataTypeConversion: '<S584>/Data Type Conversion6' */
20494 PositionFinalLimited = L4_MABX_B.SFunction1_o7_ou;
20495 if (PositionFinalLimited < 256.0) {
20496 if (PositionFinalLimited >= 0.0) {
20497 starting_index = (uint8_T)PositionFinalLimited;
20498 } else {
20499 starting_index = 0U;
20500 }
20501 } else {
20502 starting_index = MAX_uint8_T;
20503 }
20504
20505 L4_MABX_B.DataTypeConversion6_m = starting_index;
20506
20507 /* End of DataTypeConversion: '<S584>/Data Type Conversion6' */
20508
20509 /* DataTypeConversion: '<S584>/Data Type Conversion7' */
20510 PositionFinalLimited = L4_MABX_B.SFunction1_o8_m0;
20511 if (PositionFinalLimited < 256.0) {
20512 if (PositionFinalLimited >= 0.0) {
20513 starting_index = (uint8_T)PositionFinalLimited;
20514 } else {
20515 starting_index = 0U;
20516 }
20517 } else {
20518 starting_index = MAX_uint8_T;
20519 }
20520
20521 L4_MABX_B.DataTypeConversion7_h = starting_index;
20522
20523 /* End of DataTypeConversion: '<S584>/Data Type Conversion7' */
20524
20525 /* MultiPortSwitch: '<S444>/Multiport_Switch' incorporates:
20526 * Constant: '<S444>/Constant'
20527 */
20528 switch (PROPB_REAX_CHANNEL_APV) {
20529 case ENUM_CAN_RX_T_RX_CAN_1:
20530 /* DataTypeConversion: '<S582>/Data Type Conversion' */
20531 PositionFinalLimited = L4_MABX_B.SFunction1_o1_ajb;
20532 if (PositionFinalLimited < 256.0) {
20533 if (PositionFinalLimited >= 0.0) {
20534 starting_index = (uint8_T)PositionFinalLimited;
20535 } else {
20536 starting_index = 0U;
20537 }
20538 } else {
20539 starting_index = MAX_uint8_T;
20540 }
20541
20542 L4_MABX_B.DataTypeConversion_at = starting_index;
20543
20544 /* End of DataTypeConversion: '<S582>/Data Type Conversion' */
20545
20546 /* DataTypeConversion: '<S582>/Data Type Conversion1' */
20547 PositionFinalLimited = L4_MABX_B.SFunction1_o2_ej;
20548 if (PositionFinalLimited < 256.0) {
20549 if (PositionFinalLimited >= 0.0) {
20550 starting_index = (uint8_T)PositionFinalLimited;
20551 } else {
20552 starting_index = 0U;
20553 }
20554 } else {
20555 starting_index = MAX_uint8_T;
20556 }
20557
20558 L4_MABX_B.DataTypeConversion1_jt = starting_index;
20559
20560 /* End of DataTypeConversion: '<S582>/Data Type Conversion1' */
20561
20562 /* DataTypeConversion: '<S582>/Data Type Conversion2' */
20563 PositionFinalLimited = L4_MABX_B.SFunction1_o3_as;
20564 if (PositionFinalLimited < 256.0) {
20565 if (PositionFinalLimited >= 0.0) {
20566 starting_index = (uint8_T)PositionFinalLimited;
20567 } else {
20568 starting_index = 0U;
20569 }
20570 } else {
20571 starting_index = MAX_uint8_T;
20572 }
20573
20574 L4_MABX_B.DataTypeConversion2_f5c = starting_index;
20575
20576 /* End of DataTypeConversion: '<S582>/Data Type Conversion2' */
20577
20578 /* DataTypeConversion: '<S582>/Data Type Conversion3' */
20579 PositionFinalLimited = L4_MABX_B.SFunction1_o4_it;
20580 if (PositionFinalLimited < 256.0) {
20581 if (PositionFinalLimited >= 0.0) {
20582 starting_index = (uint8_T)PositionFinalLimited;
20583 } else {
20584 starting_index = 0U;
20585 }
20586 } else {
20587 starting_index = MAX_uint8_T;
20588 }
20589
20590 L4_MABX_B.DataTypeConversion3_nj = starting_index;
20591
20592 /* End of DataTypeConversion: '<S582>/Data Type Conversion3' */
20593
20594 /* DataTypeConversion: '<S582>/Data Type Conversion4' */
20595 PositionFinalLimited = L4_MABX_B.SFunction1_o5_a;
20596 if (PositionFinalLimited < 256.0) {
20597 if (PositionFinalLimited >= 0.0) {
20598 starting_index = (uint8_T)PositionFinalLimited;
20599 } else {
20600 starting_index = 0U;
20601 }
20602 } else {
20603 starting_index = MAX_uint8_T;
20604 }
20605
20606 L4_MABX_B.DataTypeConversion4_g2 = starting_index;
20607
20608 /* End of DataTypeConversion: '<S582>/Data Type Conversion4' */
20609
20610 /* DataTypeConversion: '<S582>/Data Type Conversion5' */
20611 PositionFinalLimited = L4_MABX_B.SFunction1_o6_gn;
20612 if (PositionFinalLimited < 256.0) {
20613 if (PositionFinalLimited >= 0.0) {
20614 starting_index = (uint8_T)PositionFinalLimited;
20615 } else {
20616 starting_index = 0U;
20617 }
20618 } else {
20619 starting_index = MAX_uint8_T;
20620 }
20621
20622 L4_MABX_B.DataTypeConversion5_ff = starting_index;
20623
20624 /* End of DataTypeConversion: '<S582>/Data Type Conversion5' */
20625
20626 /* DataTypeConversion: '<S582>/Data Type Conversion6' */
20627 PositionFinalLimited = L4_MABX_B.SFunction1_o7_ad;
20628 if (PositionFinalLimited < 256.0) {
20629 if (PositionFinalLimited >= 0.0) {
20630 starting_index = (uint8_T)PositionFinalLimited;
20631 } else {
20632 starting_index = 0U;
20633 }
20634 } else {
20635 starting_index = MAX_uint8_T;
20636 }
20637
20638 L4_MABX_B.DataTypeConversion6_lqm = starting_index;
20639
20640 /* End of DataTypeConversion: '<S582>/Data Type Conversion6' */
20641
20642 /* DataTypeConversion: '<S582>/Data Type Conversion7' */
20643 PositionFinalLimited = L4_MABX_B.SFunction1_o8_pl;
20644 if (PositionFinalLimited < 256.0) {
20645 if (PositionFinalLimited >= 0.0) {
20646 starting_index = (uint8_T)PositionFinalLimited;
20647 } else {
20648 starting_index = 0U;
20649 }
20650 } else {
20651 starting_index = MAX_uint8_T;
20652 }
20653
20654 L4_MABX_B.DataTypeConversion7_ci = starting_index;
20655
20656 /* End of DataTypeConversion: '<S582>/Data Type Conversion7' */
20657 L4_MABX_B.RawData_e[0] = L4_MABX_B.DataTypeConversion_at;
20658 L4_MABX_B.RawData_e[1] = L4_MABX_B.DataTypeConversion1_jt;
20659 L4_MABX_B.RawData_e[2] = L4_MABX_B.DataTypeConversion2_f5c;
20660 L4_MABX_B.RawData_e[3] = L4_MABX_B.DataTypeConversion3_nj;
20661 L4_MABX_B.RawData_e[4] = L4_MABX_B.DataTypeConversion4_g2;
20662 L4_MABX_B.RawData_e[5] = L4_MABX_B.DataTypeConversion5_ff;
20663 L4_MABX_B.RawData_e[6] = L4_MABX_B.DataTypeConversion6_lqm;
20664 L4_MABX_B.RawData_e[7] = L4_MABX_B.DataTypeConversion7_ci;
20665 break;
20666
20667 case ENUM_CAN_RX_T_RX_CAN_2:
20668 L4_MABX_B.RawData_e[0] = L4_MABX_B.DataTypeConversion_mo;
20669 L4_MABX_B.RawData_e[1] = L4_MABX_B.DataTypeConversion1_fk;
20670 L4_MABX_B.RawData_e[2] = L4_MABX_B.DataTypeConversion2_jx;
20671 L4_MABX_B.RawData_e[3] = L4_MABX_B.DataTypeConversion3_c;
20672 L4_MABX_B.RawData_e[4] = L4_MABX_B.DataTypeConversion4_ms;
20673 L4_MABX_B.RawData_e[5] = L4_MABX_B.DataTypeConversion5_p;
20674 L4_MABX_B.RawData_e[6] = L4_MABX_B.DataTypeConversion6_e3;
20675 L4_MABX_B.RawData_e[7] = L4_MABX_B.DataTypeConversion7_a;
20676 break;
20677
20678 case ENUM_CAN_RX_T_RX_CAN_3:
20679 L4_MABX_B.RawData_e[0] = L4_MABX_B.DataTypeConversion_mo;
20680 L4_MABX_B.RawData_e[1] = L4_MABX_B.DataTypeConversion1_fk;
20681 L4_MABX_B.RawData_e[2] = L4_MABX_B.DataTypeConversion2_jx;
20682 L4_MABX_B.RawData_e[3] = L4_MABX_B.DataTypeConversion3_c;
20683 L4_MABX_B.RawData_e[4] = L4_MABX_B.DataTypeConversion4_ms;
20684 L4_MABX_B.RawData_e[5] = L4_MABX_B.DataTypeConversion5_p;
20685 L4_MABX_B.RawData_e[6] = L4_MABX_B.DataTypeConversion6_e3;
20686 L4_MABX_B.RawData_e[7] = L4_MABX_B.DataTypeConversion7_a;
20687 break;
20688
20689 case ENUM_CAN_RX_T_RX_CAN_4:
20690 L4_MABX_B.RawData_e[0] = L4_MABX_B.DataTypeConversion_mo;
20691 L4_MABX_B.RawData_e[1] = L4_MABX_B.DataTypeConversion1_fk;
20692 L4_MABX_B.RawData_e[2] = L4_MABX_B.DataTypeConversion2_jx;
20693 L4_MABX_B.RawData_e[3] = L4_MABX_B.DataTypeConversion3_c;
20694 L4_MABX_B.RawData_e[4] = L4_MABX_B.DataTypeConversion4_ms;
20695 L4_MABX_B.RawData_e[5] = L4_MABX_B.DataTypeConversion5_p;
20696 L4_MABX_B.RawData_e[6] = L4_MABX_B.DataTypeConversion6_e3;
20697 L4_MABX_B.RawData_e[7] = L4_MABX_B.DataTypeConversion7_a;
20698 break;
20699
20700 case ENUM_CAN_RX_T_RX_CAN_5:
20701 L4_MABX_B.RawData_e[0] = L4_MABX_B.DataTypeConversion_mo;
20702 L4_MABX_B.RawData_e[1] = L4_MABX_B.DataTypeConversion1_fk;
20703 L4_MABX_B.RawData_e[2] = L4_MABX_B.DataTypeConversion2_jx;
20704 L4_MABX_B.RawData_e[3] = L4_MABX_B.DataTypeConversion3_c;
20705 L4_MABX_B.RawData_e[4] = L4_MABX_B.DataTypeConversion4_ms;
20706 L4_MABX_B.RawData_e[5] = L4_MABX_B.DataTypeConversion5_p;
20707 L4_MABX_B.RawData_e[6] = L4_MABX_B.DataTypeConversion6_e3;
20708 L4_MABX_B.RawData_e[7] = L4_MABX_B.DataTypeConversion7_a;
20709 break;
20710
20711 case ENUM_CAN_RX_T_RX_CAN_6:
20712 L4_MABX_B.RawData_e[0] = L4_MABX_B.DataTypeConversion_mx;
20713 L4_MABX_B.RawData_e[1] = L4_MABX_B.DataTypeConversion1_jb;
20714 L4_MABX_B.RawData_e[2] = L4_MABX_B.DataTypeConversion2_hg;
20715 L4_MABX_B.RawData_e[3] = L4_MABX_B.DataTypeConversion3_km;
20716 L4_MABX_B.RawData_e[4] = L4_MABX_B.DataTypeConversion4_e;
20717 L4_MABX_B.RawData_e[5] = L4_MABX_B.DataTypeConversion5_m;
20718 L4_MABX_B.RawData_e[6] = L4_MABX_B.DataTypeConversion6_m;
20719 L4_MABX_B.RawData_e[7] = L4_MABX_B.DataTypeConversion7_h;
20720 break;
20721
20722 default:
20723 L4_MABX_B.RawData_e[0] = L4_MABX_B.DataTypeConversion_mx;
20724 L4_MABX_B.RawData_e[1] = L4_MABX_B.DataTypeConversion1_jb;
20725 L4_MABX_B.RawData_e[2] = L4_MABX_B.DataTypeConversion2_hg;
20726 L4_MABX_B.RawData_e[3] = L4_MABX_B.DataTypeConversion3_km;
20727 L4_MABX_B.RawData_e[4] = L4_MABX_B.DataTypeConversion4_e;
20728 L4_MABX_B.RawData_e[5] = L4_MABX_B.DataTypeConversion5_m;
20729 L4_MABX_B.RawData_e[6] = L4_MABX_B.DataTypeConversion6_m;
20730 L4_MABX_B.RawData_e[7] = L4_MABX_B.DataTypeConversion7_h;
20731 break;
20732 }
20733
20734 /* S-Function (sfix_bitop): '<S672>/Operator' */
20735 L4_MABX_B.Operator_jg = (uint8_T)(L4_MABX_B.RawData_e[0] &
20736 L4_MABX_P.Operator_BitMask_jf);
20737
20738 /* DataTypeConversion: '<S672>/DataType' */
20739 L4_MABX_B.DataType_d1 = L4_MABX_B.Operator_jg;
20740
20741 /* DataTypeConversion: '<S419>/Data Type Conversion' */
20742 REAX_Current_Mode = L4_MABX_B.DataType_d1;
20743
20744 /* S-Function (sfix_bitop): '<S671>/Operator' */
20745 L4_MABX_B.Operator_nz = (uint8_T)(L4_MABX_B.RawData_e[0] &
20746 L4_MABX_P.Operator_BitMask_am);
20747
20748 /* DataTypeConversion: '<S671>/DataType' */
20749 L4_MABX_B.DataType_de = L4_MABX_B.Operator_nz;
20750
20751 /* ArithShift: '<S666>/Shift_Arithmetic ' */
20752 L4_MABX_B.PropB_REAX_3_ReqOperatingMode = (uint8_T)((uint32_T)
20753 L4_MABX_B.DataType_de >> 4);
20754
20755 /* DataTypeConversion: '<S419>/Data Type Conversion1' */
20756 REAX_Req_Mode = L4_MABX_B.PropB_REAX_3_ReqOperatingMode;
20757
20758 /* DataTypeConversion: '<S419>/Data Type Conversion2' */
20759 REAX_Status = L4_MABX_B.RawData_e[1];
20760
20761 /* DataTypeConversion: '<S668>/Data Type Conversion1' */
20762 L4_MABX_B.DataTypeConversion1_hn = L4_MABX_B.RawData_e[2];
20763
20764 /* DataTypeConversion: '<S668>/Data Type Conversion2' */
20765 L4_MABX_B.DataTypeConversion2_k = L4_MABX_B.RawData_e[3];
20766
20767 /* ArithShift: '<S668>/Shift_Arithmetic 1' */
20768 L4_MABX_B.Shift_Arithmetic1_p4 = (uint16_T)(L4_MABX_B.DataTypeConversion2_k <<
20769 8);
20770
20771 /* S-Function (sfix_bitop): '<S673>/Operator' */
20772 L4_MABX_B.Operator_pj = (uint16_T)(L4_MABX_B.DataTypeConversion1_hn |
20773 L4_MABX_B.Shift_Arithmetic1_p4);
20774
20775 /* DataTypeConversion: '<S673>/DataType' */
20776 L4_MABX_B.DataType_ia = L4_MABX_B.Operator_pj;
20777
20778 /* DataTypeConversion: '<S668>/Data Type Conversion3' */
20779 L4_MABX_B.DataTypeConversion3_kh = (int16_T)L4_MABX_B.DataType_ia;
20780
20781 /* DataTypeConversion: '<S668>/Data Type Conversion4' */
20782 L4_MABX_B.DataTypeConversion4_o = L4_MABX_B.DataTypeConversion3_kh;
20783
20784 /* Product: '<S668>/Product' incorporates:
20785 * Constant: '<S668>/Constant'
20786 */
20787 L4_MABX_B.PropB_REAX_3_HandwheelTorque = (real32_T)
20788 (L4_MABX_B.DataTypeConversion4_o * L4_MABX_P.Constant_Value_it);
20789
20790 /* DataTypeConversion: '<S419>/Data Type Conversion3' */
20791 REAX_Handwheel_Torque = L4_MABX_B.PropB_REAX_3_HandwheelTorque;
20792
20793 /* DataTypeConversion: '<S669>/Data Type Conversion4' */
20794 L4_MABX_B.DataTypeConversion4_m = L4_MABX_B.RawData_e[4];
20795
20796 /* DataTypeConversion: '<S669>/Data Type Conversion5' */
20797 L4_MABX_B.DataTypeConversion5_fe = L4_MABX_B.RawData_e[5];
20798
20799 /* ArithShift: '<S669>/Shift_Arithmetic 2' */
20800 L4_MABX_B.Shift_Arithmetic2_fo = (uint16_T)(L4_MABX_B.DataTypeConversion5_fe <<
20801 8);
20802
20803 /* S-Function (sfix_bitop): '<S674>/Operator' */
20804 L4_MABX_B.Operator_ol = (uint16_T)(L4_MABX_B.DataTypeConversion4_m |
20805 L4_MABX_B.Shift_Arithmetic2_fo);
20806
20807 /* DataTypeConversion: '<S674>/DataType' */
20808 L4_MABX_B.DataType_hk = L4_MABX_B.Operator_ol;
20809
20810 /* DataTypeConversion: '<S669>/Data Type Conversion6' */
20811 L4_MABX_B.DataTypeConversion6_k = (int16_T)L4_MABX_B.DataType_hk;
20812
20813 /* DataTypeConversion: '<S669>/Data Type Conversion1' */
20814 L4_MABX_B.DataTypeConversion1_i = L4_MABX_B.DataTypeConversion6_k;
20815
20816 /* Product: '<S669>/Product1' incorporates:
20817 * Constant: '<S669>/Constant1'
20818 */
20819 L4_MABX_B.PropB_REAX_3_HandwheelVelocity = (real32_T)
20820 (L4_MABX_B.DataTypeConversion1_i * L4_MABX_P.Constant1_Value_is);
20821
20822 /* DataTypeConversion: '<S419>/Data Type Conversion4' */
20823 REAX_Handwheel_Velocity = L4_MABX_B.PropB_REAX_3_HandwheelVelocity;
20824
20825 /* DataTypeConversion: '<S670>/Data Type Conversion7' */
20826 L4_MABX_B.DataTypeConversion7_b = L4_MABX_B.RawData_e[6];
20827
20828 /* DataTypeConversion: '<S670>/Data Type Conversion8' */
20829 L4_MABX_B.DataTypeConversion8_l = L4_MABX_B.RawData_e[7];
20830
20831 /* ArithShift: '<S670>/Shift_Arithmetic 3' */
20832 L4_MABX_B.Shift_Arithmetic3_ih = (uint16_T)(L4_MABX_B.DataTypeConversion8_l <<
20833 8);
20834
20835 /* S-Function (sfix_bitop): '<S675>/Operator' */
20836 L4_MABX_B.Operator_ik = (uint16_T)(L4_MABX_B.DataTypeConversion7_b |
20837 L4_MABX_B.Shift_Arithmetic3_ih);
20838
20839 /* DataTypeConversion: '<S675>/DataType' */
20840 L4_MABX_B.DataType_bp = L4_MABX_B.Operator_ik;
20841
20842 /* DataTypeConversion: '<S670>/Data Type Conversion9' */
20843 L4_MABX_B.DataTypeConversion9_k = (int16_T)L4_MABX_B.DataType_bp;
20844
20845 /* DataTypeConversion: '<S670>/Data Type Conversion1' */
20846 L4_MABX_B.DataTypeConversion1_n = L4_MABX_B.DataTypeConversion9_k;
20847
20848 /* Product: '<S670>/Product2' incorporates:
20849 * Constant: '<S670>/Constant2'
20850 */
20851 L4_MABX_B.PropB_REAX_3_PullCompensation = (real32_T)
20852 (L4_MABX_B.DataTypeConversion1_n * L4_MABX_P.Constant2_Value_hx);
20853
20854 /* DataTypeConversion: '<S419>/Data Type Conversion5' */
20855 REAX_Pull_Compensation = L4_MABX_B.PropB_REAX_3_PullCompensation;
20856
20857 /* DataTypeConversion: '<S583>/Data Type Conversion8' */
20858 L4_MABX_B.RX_status_cw = (L4_MABX_B.SFunction1_o9_mi != 0.0);
20859
20860 /* DataTypeConversion: '<S584>/Data Type Conversion8' */
20861 L4_MABX_B.RX_status_b = (L4_MABX_B.SFunction1_o9_l != 0.0);
20862
20863 /* MultiPortSwitch: '<S444>/Multiport_Switch' incorporates:
20864 * Constant: '<S444>/Constant'
20865 */
20866 switch (PROPB_REAX_CHANNEL_APV) {
20867 case ENUM_CAN_RX_T_RX_CAN_1:
20868 /* DataTypeConversion: '<S582>/Data Type Conversion8' */
20869 L4_MABX_B.RX_status_ek = (L4_MABX_B.SFunction1_o9_le != 0.0);
20870 L4_MABX_B.RX_status_av = L4_MABX_B.RX_status_ek;
20871 break;
20872
20873 case ENUM_CAN_RX_T_RX_CAN_2:
20874 L4_MABX_B.RX_status_av = L4_MABX_B.RX_status_cw;
20875 break;
20876
20877 case ENUM_CAN_RX_T_RX_CAN_3:
20878 L4_MABX_B.RX_status_av = L4_MABX_B.RX_status_cw;
20879 break;
20880
20881 case ENUM_CAN_RX_T_RX_CAN_4:
20882 L4_MABX_B.RX_status_av = L4_MABX_B.RX_status_cw;
20883 break;
20884
20885 case ENUM_CAN_RX_T_RX_CAN_5:
20886 L4_MABX_B.RX_status_av = L4_MABX_B.RX_status_cw;
20887 break;
20888
20889 case ENUM_CAN_RX_T_RX_CAN_6:
20890 L4_MABX_B.RX_status_av = L4_MABX_B.RX_status_b;
20891 break;
20892
20893 default:
20894 L4_MABX_B.RX_status_av = L4_MABX_B.RX_status_b;
20895 break;
20896 }
20897
20898 /* DataTypeConversion: '<S583>/Data Type Conversion9' */
20899 L4_MABX_B.RX_time_pz = L4_MABX_B.SFunction1_o10_g;
20900
20901 /* DataTypeConversion: '<S584>/Data Type Conversion9' */
20902 L4_MABX_B.RX_time_jq = L4_MABX_B.SFunction1_o10_c;
20903
20904 /* MultiPortSwitch: '<S444>/Multiport_Switch' incorporates:
20905 * Constant: '<S444>/Constant'
20906 */
20907 switch (PROPB_REAX_CHANNEL_APV) {
20908 case ENUM_CAN_RX_T_RX_CAN_1:
20909 /* DataTypeConversion: '<S582>/Data Type Conversion9' */
20910 L4_MABX_B.RX_time_df = L4_MABX_B.SFunction1_o10_m;
20911 L4_MABX_B.RX_time_in = L4_MABX_B.RX_time_df;
20912 break;
20913
20914 case ENUM_CAN_RX_T_RX_CAN_2:
20915 L4_MABX_B.RX_time_in = L4_MABX_B.RX_time_pz;
20916 break;
20917
20918 case ENUM_CAN_RX_T_RX_CAN_3:
20919 L4_MABX_B.RX_time_in = L4_MABX_B.RX_time_pz;
20920 break;
20921
20922 case ENUM_CAN_RX_T_RX_CAN_4:
20923 L4_MABX_B.RX_time_in = L4_MABX_B.RX_time_pz;
20924 break;
20925
20926 case ENUM_CAN_RX_T_RX_CAN_5:
20927 L4_MABX_B.RX_time_in = L4_MABX_B.RX_time_pz;
20928 break;
20929
20930 case ENUM_CAN_RX_T_RX_CAN_6:
20931 L4_MABX_B.RX_time_in = L4_MABX_B.RX_time_jq;
20932 break;
20933
20934 default:
20935 L4_MABX_B.RX_time_in = L4_MABX_B.RX_time_jq;
20936 break;
20937 }
20938
20939 /* DataTypeConversion: '<S583>/Data Type Conversion10' */
20940 L4_MABX_B.RX_delta_time_iu = L4_MABX_B.SFunction1_o11_f;
20941
20942 /* DataTypeConversion: '<S584>/Data Type Conversion10' */
20943 L4_MABX_B.RX_delta_time_cw = L4_MABX_B.SFunction1_o11_l;
20944
20945 /* MultiPortSwitch: '<S444>/Multiport_Switch' incorporates:
20946 * Constant: '<S444>/Constant'
20947 */
20948 switch (PROPB_REAX_CHANNEL_APV) {
20949 case ENUM_CAN_RX_T_RX_CAN_1:
20950 /* DataTypeConversion: '<S582>/Data Type Conversion10' */
20951 L4_MABX_B.RX_delta_time_id = L4_MABX_B.SFunction1_o11_h;
20952 L4_MABX_B.RX_delta_time_az = L4_MABX_B.RX_delta_time_id;
20953 break;
20954
20955 case ENUM_CAN_RX_T_RX_CAN_2:
20956 L4_MABX_B.RX_delta_time_az = L4_MABX_B.RX_delta_time_iu;
20957 break;
20958
20959 case ENUM_CAN_RX_T_RX_CAN_3:
20960 L4_MABX_B.RX_delta_time_az = L4_MABX_B.RX_delta_time_iu;
20961 break;
20962
20963 case ENUM_CAN_RX_T_RX_CAN_4:
20964 L4_MABX_B.RX_delta_time_az = L4_MABX_B.RX_delta_time_iu;
20965 break;
20966
20967 case ENUM_CAN_RX_T_RX_CAN_5:
20968 L4_MABX_B.RX_delta_time_az = L4_MABX_B.RX_delta_time_iu;
20969 break;
20970
20971 case ENUM_CAN_RX_T_RX_CAN_6:
20972 L4_MABX_B.RX_delta_time_az = L4_MABX_B.RX_delta_time_cw;
20973 break;
20974
20975 default:
20976 L4_MABX_B.RX_delta_time_az = L4_MABX_B.RX_delta_time_cw;
20977 break;
20978 }
20979
20980 /* RelationalOperator: '<S591>/Operator' incorporates:
20981 * Constant: '<S444>/Constant'
20982 * Constant: '<S585>/Constant2'
20983 */
20984 L4_MABX_B.Operator_pi = (PROPB_REAX_CHANNEL_APV ==
20985 L4_MABX_P.Constant2_Value_es);
20986
20987 /* RelationalOperator: '<S592>/Operator' incorporates:
20988 * Constant: '<S444>/Constant'
20989 * Constant: '<S585>/Constant3'
20990 */
20991 L4_MABX_B.Operator_n5 = (PROPB_REAX_CHANNEL_APV ==
20992 L4_MABX_P.Constant3_Value_g4);
20993
20994 /* RelationalOperator: '<S593>/Operator' incorporates:
20995 * Constant: '<S444>/Constant'
20996 * Constant: '<S585>/Constant4'
20997 */
20998 L4_MABX_B.Operator_jya = (PROPB_REAX_CHANNEL_APV ==
20999 L4_MABX_P.Constant4_Value_k5);
21000
21001 /* RelationalOperator: '<S602>/Operator' incorporates:
21002 * Constant: '<S445>/Constant'
21003 * Constant: '<S598>/Constant'
21004 */
21005 L4_MABX_B.Operator_kp = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant_Value_ij);
21006
21007 /* Outputs for Enabled SubSystem: '<S595>/CAN_TYPE1_RX_M1_C1' incorporates:
21008 * EnablePort: '<S599>/Enable'
21009 */
21010 if (L4_MABX_B.Operator_kp) {
21011 /* S-Function (rti_commonblock): '<S599>/S-Function1' */
21012 /* This comment workarounds a code generation problem */
21013
21014 /* dSPACE RTICAN RX Message Block: "PropB_REAX_4_13" Id:419428115 */
21015 {
21016 UInt32 *CAN_Msg;
21017 static dsfloat time_old = 0.0;
21018
21019 /* Read status and timestamp info (previous message) */
21020 if (can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].timestamp !=
21021 time_old) {
21022 /* ... save timestamp info for the calculation of the RX status
21023 during the consecutive sample hit*/
21024 time_old = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].
21025 timestamp;
21026
21027 /* ... set the processed flag to one */
21028 L4_MABX_B.SFunction1_o9_ii = 1.0;
21029 L4_MABX_B.SFunction1_o10_d = (real_T)
21030 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].timestamp;
21031 L4_MABX_B.SFunction1_o11_m = (real_T)
21032 can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].deltatime;
21033 CAN_Msg = can_type1_M1_C1_XTD[CANTP1_M1_C1_RXSRVC_XTD_0x18FFF713].data;
21034
21035 /* Decode CAN message */
21036 {
21037 {
21038 rtican_Signal_t CAN_Sgn;
21039
21040 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
21041 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
21042 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21043 L4_MABX_B.SFunction1_o1_ld = ((real_T) CAN_Sgn.UnsignedSgn);
21044
21045 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
21046 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
21047 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21048 L4_MABX_B.SFunction1_o2_g4 = ((real_T) CAN_Sgn.UnsignedSgn);
21049
21050 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
21051 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
21052 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21053 L4_MABX_B.SFunction1_o3_h1 = ((real_T) CAN_Sgn.UnsignedSgn);
21054
21055 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
21056 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
21057 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21058 L4_MABX_B.SFunction1_o4_pp = ((real_T) CAN_Sgn.UnsignedSgn);
21059
21060 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
21061 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
21062 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21063 L4_MABX_B.SFunction1_o5_hd = ((real_T) CAN_Sgn.UnsignedSgn);
21064
21065 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
21066 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
21067 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21068 L4_MABX_B.SFunction1_o6_f4 = ((real_T) CAN_Sgn.UnsignedSgn);
21069
21070 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
21071 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
21072 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21073 L4_MABX_B.SFunction1_o7_kv = ((real_T) CAN_Sgn.UnsignedSgn);
21074
21075 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
21076 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
21077 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21078 L4_MABX_B.SFunction1_o8_m = ((real_T) CAN_Sgn.UnsignedSgn);
21079 }
21080 }
21081 } else {
21082 /* set RX status to 0 because no new message has arrived */
21083 L4_MABX_B.SFunction1_o9_ii = 0.0;
21084 }
21085 }
21086 }
21087
21088 /* End of Outputs for SubSystem: '<S595>/CAN_TYPE1_RX_M1_C1' */
21089
21090 /* RelationalOperator: '<S603>/Operator' incorporates:
21091 * Constant: '<S445>/Constant'
21092 * Constant: '<S598>/Constant1'
21093 */
21094 L4_MABX_B.Operator_jge = (PROPB_REAX_CHANNEL_APV ==
21095 L4_MABX_P.Constant1_Value_oih);
21096
21097 /* Outputs for Enabled SubSystem: '<S596>/CAN_TYPE1_RX_M1_C2' incorporates:
21098 * EnablePort: '<S600>/Enable'
21099 */
21100 if (L4_MABX_B.Operator_jge) {
21101 /* S-Function (rti_commonblock): '<S600>/S-Function1' */
21102 /* This comment workarounds a code generation problem */
21103
21104 /* dSPACE RTICAN RX Message Block: "PropB_REAX_4_13" Id:419428115 */
21105 {
21106 UInt32 *CAN_Msg;
21107 static dsfloat time_old = 0.0;
21108
21109 /* Read status and timestamp info (previous message) */
21110 if (can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].timestamp !=
21111 time_old) {
21112 /* ... save timestamp info for the calculation of the RX status
21113 during the consecutive sample hit*/
21114 time_old = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].
21115 timestamp;
21116
21117 /* ... set the processed flag to one */
21118 L4_MABX_B.SFunction1_o9_h = 1.0;
21119 L4_MABX_B.SFunction1_o10_e = (real_T)
21120 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].timestamp;
21121 L4_MABX_B.SFunction1_o11_c = (real_T)
21122 can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].deltatime;
21123 CAN_Msg = can_type1_M1_C2_XTD[CANTP1_M1_C2_RXSRVC_XTD_0x18FFF713].data;
21124
21125 /* Decode CAN message */
21126 {
21127 {
21128 rtican_Signal_t CAN_Sgn;
21129
21130 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
21131 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
21132 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21133 L4_MABX_B.SFunction1_o1_dr = ((real_T) CAN_Sgn.UnsignedSgn);
21134
21135 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
21136 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
21137 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21138 L4_MABX_B.SFunction1_o2_gv = ((real_T) CAN_Sgn.UnsignedSgn);
21139
21140 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
21141 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
21142 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21143 L4_MABX_B.SFunction1_o3_p0 = ((real_T) CAN_Sgn.UnsignedSgn);
21144
21145 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
21146 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
21147 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21148 L4_MABX_B.SFunction1_o4_hs = ((real_T) CAN_Sgn.UnsignedSgn);
21149
21150 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
21151 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
21152 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21153 L4_MABX_B.SFunction1_o5_e = ((real_T) CAN_Sgn.UnsignedSgn);
21154
21155 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
21156 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
21157 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21158 L4_MABX_B.SFunction1_o6_ix = ((real_T) CAN_Sgn.UnsignedSgn);
21159
21160 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
21161 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
21162 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21163 L4_MABX_B.SFunction1_o7_nn = ((real_T) CAN_Sgn.UnsignedSgn);
21164
21165 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
21166 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
21167 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21168 L4_MABX_B.SFunction1_o8_p = ((real_T) CAN_Sgn.UnsignedSgn);
21169 }
21170 }
21171 } else {
21172 /* set RX status to 0 because no new message has arrived */
21173 L4_MABX_B.SFunction1_o9_h = 0.0;
21174 }
21175 }
21176 }
21177
21178 /* End of Outputs for SubSystem: '<S596>/CAN_TYPE1_RX_M1_C2' */
21179
21180 /* RelationalOperator: '<S607>/Operator' incorporates:
21181 * Constant: '<S445>/Constant'
21182 * Constant: '<S598>/Constant5'
21183 */
21184 L4_MABX_B.Operator_iq3 = (PROPB_REAX_CHANNEL_APV ==
21185 L4_MABX_P.Constant5_Value_k2);
21186
21187 /* Outputs for Enabled SubSystem: '<S597>/CAN_TYPE1_RX_M3_C2' incorporates:
21188 * EnablePort: '<S601>/Enable'
21189 */
21190 if (L4_MABX_B.Operator_iq3) {
21191 /* S-Function (rti_commonblock): '<S601>/S-Function1' */
21192 /* This comment workarounds a code generation problem */
21193
21194 /* dSPACE RTICAN RX Message Block: "PropB_REAX_4_13" Id:486536979 */
21195 {
21196 UInt32 *CAN_Msg;
21197 static dsfloat time_old = 0.0;
21198
21199 /* Read status and timestamp info (previous message) */
21200 if (can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].timestamp !=
21201 time_old) {
21202 /* ... save timestamp info for the calculation of the RX status
21203 during the consecutive sample hit*/
21204 time_old = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].
21205 timestamp;
21206
21207 /* ... set the processed flag to one */
21208 L4_MABX_B.SFunction1_o9_ch = 1.0;
21209 L4_MABX_B.SFunction1_o10_p = (real_T)
21210 can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].timestamp;
21211 L4_MABX_B.SFunction1_o11_a = (real_T)
21212 can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].deltatime;
21213 CAN_Msg = can_type1_M3_C2_XTD[CANTP1_M3_C2_RXSRVC_XTD_0x1CFFF713].data;
21214
21215 /* Decode CAN message */
21216 {
21217 {
21218 rtican_Signal_t CAN_Sgn;
21219
21220 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
21221 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[0];
21222 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21223 L4_MABX_B.SFunction1_o1_dp = ((real_T) CAN_Sgn.UnsignedSgn);
21224
21225 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
21226 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[1];
21227 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21228 L4_MABX_B.SFunction1_o2_dc = ((real_T) CAN_Sgn.UnsignedSgn);
21229
21230 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
21231 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[2];
21232 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21233 L4_MABX_B.SFunction1_o3_k = ((real_T) CAN_Sgn.UnsignedSgn);
21234
21235 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
21236 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[3];
21237 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21238 L4_MABX_B.SFunction1_o4_ah = ((real_T) CAN_Sgn.UnsignedSgn);
21239
21240 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
21241 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[4];
21242 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21243 L4_MABX_B.SFunction1_o5_dl = ((real_T) CAN_Sgn.UnsignedSgn);
21244
21245 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
21246 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[5];
21247 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21248 L4_MABX_B.SFunction1_o6_o2 = ((real_T) CAN_Sgn.UnsignedSgn);
21249
21250 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
21251 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[6];
21252 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21253 L4_MABX_B.SFunction1_o7_n = ((real_T) CAN_Sgn.UnsignedSgn);
21254
21255 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
21256 CAN_Sgn.SgnBytes.Byte0 = CAN_Msg[7];
21257 CAN_Sgn.UnsignedSgn &= 0x000000FF;
21258 L4_MABX_B.SFunction1_o8_dr = ((real_T) CAN_Sgn.UnsignedSgn);
21259 }
21260 }
21261 } else {
21262 /* set RX status to 0 because no new message has arrived */
21263 L4_MABX_B.SFunction1_o9_ch = 0.0;
21264 }
21265 }
21266 }
21267
21268 /* End of Outputs for SubSystem: '<S597>/CAN_TYPE1_RX_M3_C2' */
21269
21270 /* DataTypeConversion: '<S597>/Data Type Conversion' */
21271 PositionFinalLimited = L4_MABX_B.SFunction1_o1_dp;
21272 if (PositionFinalLimited < 256.0) {
21273 if (PositionFinalLimited >= 0.0) {
21274 starting_index = (uint8_T)PositionFinalLimited;
21275 } else {
21276 starting_index = 0U;
21277 }
21278 } else {
21279 starting_index = MAX_uint8_T;
21280 }
21281
21282 L4_MABX_B.DataTypeConversion_gt = starting_index;
21283
21284 /* End of DataTypeConversion: '<S597>/Data Type Conversion' */
21285
21286 /* DataTypeConversion: '<S597>/Data Type Conversion1' */
21287 PositionFinalLimited = L4_MABX_B.SFunction1_o2_dc;
21288 if (PositionFinalLimited < 256.0) {
21289 if (PositionFinalLimited >= 0.0) {
21290 starting_index = (uint8_T)PositionFinalLimited;
21291 } else {
21292 starting_index = 0U;
21293 }
21294 } else {
21295 starting_index = MAX_uint8_T;
21296 }
21297
21298 L4_MABX_B.DataTypeConversion1_evi = starting_index;
21299
21300 /* End of DataTypeConversion: '<S597>/Data Type Conversion1' */
21301
21302 /* DataTypeConversion: '<S597>/Data Type Conversion2' */
21303 PositionFinalLimited = L4_MABX_B.SFunction1_o3_k;
21304 if (PositionFinalLimited < 256.0) {
21305 if (PositionFinalLimited >= 0.0) {
21306 starting_index = (uint8_T)PositionFinalLimited;
21307 } else {
21308 starting_index = 0U;
21309 }
21310 } else {
21311 starting_index = MAX_uint8_T;
21312 }
21313
21314 L4_MABX_B.DataTypeConversion2_lr = starting_index;
21315
21316 /* End of DataTypeConversion: '<S597>/Data Type Conversion2' */
21317
21318 /* DataTypeConversion: '<S597>/Data Type Conversion3' */
21319 PositionFinalLimited = L4_MABX_B.SFunction1_o4_ah;
21320 if (PositionFinalLimited < 256.0) {
21321 if (PositionFinalLimited >= 0.0) {
21322 starting_index = (uint8_T)PositionFinalLimited;
21323 } else {
21324 starting_index = 0U;
21325 }
21326 } else {
21327 starting_index = MAX_uint8_T;
21328 }
21329
21330 L4_MABX_B.DataTypeConversion3_a3 = starting_index;
21331
21332 /* End of DataTypeConversion: '<S597>/Data Type Conversion3' */
21333
21334 /* DataTypeConversion: '<S597>/Data Type Conversion4' */
21335 PositionFinalLimited = L4_MABX_B.SFunction1_o5_dl;
21336 if (PositionFinalLimited < 256.0) {
21337 if (PositionFinalLimited >= 0.0) {
21338 starting_index = (uint8_T)PositionFinalLimited;
21339 } else {
21340 starting_index = 0U;
21341 }
21342 } else {
21343 starting_index = MAX_uint8_T;
21344 }
21345
21346 L4_MABX_B.DataTypeConversion4_it = starting_index;
21347
21348 /* End of DataTypeConversion: '<S597>/Data Type Conversion4' */
21349
21350 /* DataTypeConversion: '<S597>/Data Type Conversion5' */
21351 PositionFinalLimited = L4_MABX_B.SFunction1_o6_o2;
21352 if (PositionFinalLimited < 256.0) {
21353 if (PositionFinalLimited >= 0.0) {
21354 starting_index = (uint8_T)PositionFinalLimited;
21355 } else {
21356 starting_index = 0U;
21357 }
21358 } else {
21359 starting_index = MAX_uint8_T;
21360 }
21361
21362 L4_MABX_B.DataTypeConversion5_nf = starting_index;
21363
21364 /* End of DataTypeConversion: '<S597>/Data Type Conversion5' */
21365
21366 /* DataTypeConversion: '<S597>/Data Type Conversion6' */
21367 PositionFinalLimited = L4_MABX_B.SFunction1_o7_n;
21368 if (PositionFinalLimited < 256.0) {
21369 if (PositionFinalLimited >= 0.0) {
21370 starting_index = (uint8_T)PositionFinalLimited;
21371 } else {
21372 starting_index = 0U;
21373 }
21374 } else {
21375 starting_index = MAX_uint8_T;
21376 }
21377
21378 L4_MABX_B.DataTypeConversion6_l = starting_index;
21379
21380 /* End of DataTypeConversion: '<S597>/Data Type Conversion6' */
21381
21382 /* DataTypeConversion: '<S597>/Data Type Conversion7' */
21383 PositionFinalLimited = L4_MABX_B.SFunction1_o8_dr;
21384 if (PositionFinalLimited < 256.0) {
21385 if (PositionFinalLimited >= 0.0) {
21386 starting_index = (uint8_T)PositionFinalLimited;
21387 } else {
21388 starting_index = 0U;
21389 }
21390 } else {
21391 starting_index = MAX_uint8_T;
21392 }
21393
21394 L4_MABX_B.DataTypeConversion7_p = starting_index;
21395
21396 /* End of DataTypeConversion: '<S597>/Data Type Conversion7' */
21397
21398 /* MultiPortSwitch: '<S445>/Multiport_Switch' incorporates:
21399 * Constant: '<S445>/Constant'
21400 */
21401 switch (PROPB_REAX_CHANNEL_APV) {
21402 case ENUM_CAN_RX_T_RX_CAN_1:
21403 /* DataTypeConversion: '<S595>/Data Type Conversion' */
21404 PositionFinalLimited = L4_MABX_B.SFunction1_o1_ld;
21405 if (PositionFinalLimited < 256.0) {
21406 if (PositionFinalLimited >= 0.0) {
21407 starting_index = (uint8_T)PositionFinalLimited;
21408 } else {
21409 starting_index = 0U;
21410 }
21411 } else {
21412 starting_index = MAX_uint8_T;
21413 }
21414
21415 L4_MABX_B.DataTypeConversion_ec = starting_index;
21416
21417 /* End of DataTypeConversion: '<S595>/Data Type Conversion' */
21418
21419 /* DataTypeConversion: '<S595>/Data Type Conversion1' */
21420 PositionFinalLimited = L4_MABX_B.SFunction1_o2_g4;
21421 if (PositionFinalLimited < 256.0) {
21422 if (PositionFinalLimited >= 0.0) {
21423 starting_index = (uint8_T)PositionFinalLimited;
21424 } else {
21425 starting_index = 0U;
21426 }
21427 } else {
21428 starting_index = MAX_uint8_T;
21429 }
21430
21431 L4_MABX_B.DataTypeConversion1_or = starting_index;
21432
21433 /* End of DataTypeConversion: '<S595>/Data Type Conversion1' */
21434
21435 /* DataTypeConversion: '<S595>/Data Type Conversion2' */
21436 PositionFinalLimited = L4_MABX_B.SFunction1_o3_h1;
21437 if (PositionFinalLimited < 256.0) {
21438 if (PositionFinalLimited >= 0.0) {
21439 starting_index = (uint8_T)PositionFinalLimited;
21440 } else {
21441 starting_index = 0U;
21442 }
21443 } else {
21444 starting_index = MAX_uint8_T;
21445 }
21446
21447 L4_MABX_B.DataTypeConversion2_d0 = starting_index;
21448
21449 /* End of DataTypeConversion: '<S595>/Data Type Conversion2' */
21450
21451 /* DataTypeConversion: '<S595>/Data Type Conversion3' */
21452 PositionFinalLimited = L4_MABX_B.SFunction1_o4_pp;
21453 if (PositionFinalLimited < 256.0) {
21454 if (PositionFinalLimited >= 0.0) {
21455 starting_index = (uint8_T)PositionFinalLimited;
21456 } else {
21457 starting_index = 0U;
21458 }
21459 } else {
21460 starting_index = MAX_uint8_T;
21461 }
21462
21463 L4_MABX_B.DataTypeConversion3_eb = starting_index;
21464
21465 /* End of DataTypeConversion: '<S595>/Data Type Conversion3' */
21466
21467 /* DataTypeConversion: '<S595>/Data Type Conversion4' */
21468 PositionFinalLimited = L4_MABX_B.SFunction1_o5_hd;
21469 if (PositionFinalLimited < 256.0) {
21470 if (PositionFinalLimited >= 0.0) {
21471 starting_index = (uint8_T)PositionFinalLimited;
21472 } else {
21473 starting_index = 0U;
21474 }
21475 } else {
21476 starting_index = MAX_uint8_T;
21477 }
21478
21479 L4_MABX_B.DataTypeConversion4_mw = starting_index;
21480
21481 /* End of DataTypeConversion: '<S595>/Data Type Conversion4' */
21482
21483 /* DataTypeConversion: '<S595>/Data Type Conversion5' */
21484 PositionFinalLimited = L4_MABX_B.SFunction1_o6_f4;
21485 if (PositionFinalLimited < 256.0) {
21486 if (PositionFinalLimited >= 0.0) {
21487 starting_index = (uint8_T)PositionFinalLimited;
21488 } else {
21489 starting_index = 0U;
21490 }
21491 } else {
21492 starting_index = MAX_uint8_T;
21493 }
21494
21495 L4_MABX_B.DataTypeConversion5_j3i = starting_index;
21496
21497 /* End of DataTypeConversion: '<S595>/Data Type Conversion5' */
21498
21499 /* DataTypeConversion: '<S595>/Data Type Conversion6' */
21500 PositionFinalLimited = L4_MABX_B.SFunction1_o7_kv;
21501 if (PositionFinalLimited < 256.0) {
21502 if (PositionFinalLimited >= 0.0) {
21503 starting_index = (uint8_T)PositionFinalLimited;
21504 } else {
21505 starting_index = 0U;
21506 }
21507 } else {
21508 starting_index = MAX_uint8_T;
21509 }
21510
21511 L4_MABX_B.DataTypeConversion6_ee = starting_index;
21512
21513 /* End of DataTypeConversion: '<S595>/Data Type Conversion6' */
21514
21515 /* DataTypeConversion: '<S595>/Data Type Conversion7' */
21516 PositionFinalLimited = L4_MABX_B.SFunction1_o8_m;
21517 if (PositionFinalLimited < 256.0) {
21518 if (PositionFinalLimited >= 0.0) {
21519 starting_index = (uint8_T)PositionFinalLimited;
21520 } else {
21521 starting_index = 0U;
21522 }
21523 } else {
21524 starting_index = MAX_uint8_T;
21525 }
21526
21527 L4_MABX_B.DataTypeConversion7_m = starting_index;
21528
21529 /* End of DataTypeConversion: '<S595>/Data Type Conversion7' */
21530 L4_MABX_B.RawData_i[0] = L4_MABX_B.DataTypeConversion_ec;
21531 L4_MABX_B.RawData_i[1] = L4_MABX_B.DataTypeConversion1_or;
21532 L4_MABX_B.RawData_i[2] = L4_MABX_B.DataTypeConversion2_d0;
21533 L4_MABX_B.RawData_i[3] = L4_MABX_B.DataTypeConversion3_eb;
21534 L4_MABX_B.RawData_i[4] = L4_MABX_B.DataTypeConversion4_mw;
21535 L4_MABX_B.RawData_i[5] = L4_MABX_B.DataTypeConversion5_j3i;
21536 L4_MABX_B.RawData_i[6] = L4_MABX_B.DataTypeConversion6_ee;
21537 L4_MABX_B.RawData_i[7] = L4_MABX_B.DataTypeConversion7_m;
21538 break;
21539
21540 case ENUM_CAN_RX_T_RX_CAN_2:
21541 /* DataTypeConversion: '<S596>/Data Type Conversion' */
21542 PositionFinalLimited = L4_MABX_B.SFunction1_o1_dr;
21543 if (PositionFinalLimited < 256.0) {
21544 if (PositionFinalLimited >= 0.0) {
21545 starting_index = (uint8_T)PositionFinalLimited;
21546 } else {
21547 starting_index = 0U;
21548 }
21549 } else {
21550 starting_index = MAX_uint8_T;
21551 }
21552
21553 L4_MABX_B.DataTypeConversion_ha = starting_index;
21554
21555 /* End of DataTypeConversion: '<S596>/Data Type Conversion' */
21556
21557 /* DataTypeConversion: '<S596>/Data Type Conversion1' */
21558 PositionFinalLimited = L4_MABX_B.SFunction1_o2_gv;
21559 if (PositionFinalLimited < 256.0) {
21560 if (PositionFinalLimited >= 0.0) {
21561 starting_index = (uint8_T)PositionFinalLimited;
21562 } else {
21563 starting_index = 0U;
21564 }
21565 } else {
21566 starting_index = MAX_uint8_T;
21567 }
21568
21569 L4_MABX_B.DataTypeConversion1_nu = starting_index;
21570
21571 /* End of DataTypeConversion: '<S596>/Data Type Conversion1' */
21572
21573 /* DataTypeConversion: '<S596>/Data Type Conversion2' */
21574 PositionFinalLimited = L4_MABX_B.SFunction1_o3_p0;
21575 if (PositionFinalLimited < 256.0) {
21576 if (PositionFinalLimited >= 0.0) {
21577 starting_index = (uint8_T)PositionFinalLimited;
21578 } else {
21579 starting_index = 0U;
21580 }
21581 } else {
21582 starting_index = MAX_uint8_T;
21583 }
21584
21585 L4_MABX_B.DataTypeConversion2_m5 = starting_index;
21586
21587 /* End of DataTypeConversion: '<S596>/Data Type Conversion2' */
21588
21589 /* DataTypeConversion: '<S596>/Data Type Conversion3' */
21590 PositionFinalLimited = L4_MABX_B.SFunction1_o4_hs;
21591 if (PositionFinalLimited < 256.0) {
21592 if (PositionFinalLimited >= 0.0) {
21593 starting_index = (uint8_T)PositionFinalLimited;
21594 } else {
21595 starting_index = 0U;
21596 }
21597 } else {
21598 starting_index = MAX_uint8_T;
21599 }
21600
21601 L4_MABX_B.DataTypeConversion3_by = starting_index;
21602
21603 /* End of DataTypeConversion: '<S596>/Data Type Conversion3' */
21604
21605 /* DataTypeConversion: '<S596>/Data Type Conversion4' */
21606 PositionFinalLimited = L4_MABX_B.SFunction1_o5_e;
21607 if (PositionFinalLimited < 256.0) {
21608 if (PositionFinalLimited >= 0.0) {
21609 starting_index = (uint8_T)PositionFinalLimited;
21610 } else {
21611 starting_index = 0U;
21612 }
21613 } else {
21614 starting_index = MAX_uint8_T;
21615 }
21616
21617 L4_MABX_B.DataTypeConversion4_fl = starting_index;
21618
21619 /* End of DataTypeConversion: '<S596>/Data Type Conversion4' */
21620
21621 /* DataTypeConversion: '<S596>/Data Type Conversion5' */
21622 PositionFinalLimited = L4_MABX_B.SFunction1_o6_ix;
21623 if (PositionFinalLimited < 256.0) {
21624 if (PositionFinalLimited >= 0.0) {
21625 starting_index = (uint8_T)PositionFinalLimited;
21626 } else {
21627 starting_index = 0U;
21628 }
21629 } else {
21630 starting_index = MAX_uint8_T;
21631 }
21632
21633 L4_MABX_B.DataTypeConversion5_gi = starting_index;
21634
21635 /* End of DataTypeConversion: '<S596>/Data Type Conversion5' */
21636
21637 /* DataTypeConversion: '<S596>/Data Type Conversion6' */
21638 PositionFinalLimited = L4_MABX_B.SFunction1_o7_nn;
21639 if (PositionFinalLimited < 256.0) {
21640 if (PositionFinalLimited >= 0.0) {
21641 starting_index = (uint8_T)PositionFinalLimited;
21642 } else {
21643 starting_index = 0U;
21644 }
21645 } else {
21646 starting_index = MAX_uint8_T;
21647 }
21648
21649 L4_MABX_B.DataTypeConversion6_af = starting_index;
21650
21651 /* End of DataTypeConversion: '<S596>/Data Type Conversion6' */
21652
21653 /* DataTypeConversion: '<S596>/Data Type Conversion7' */
21654 PositionFinalLimited = L4_MABX_B.SFunction1_o8_p;
21655 if (PositionFinalLimited < 256.0) {
21656 if (PositionFinalLimited >= 0.0) {
21657 starting_index = (uint8_T)PositionFinalLimited;
21658 } else {
21659 starting_index = 0U;
21660 }
21661 } else {
21662 starting_index = MAX_uint8_T;
21663 }
21664
21665 L4_MABX_B.DataTypeConversion7_j = starting_index;
21666
21667 /* End of DataTypeConversion: '<S596>/Data Type Conversion7' */
21668 L4_MABX_B.RawData_i[0] = L4_MABX_B.DataTypeConversion_ha;
21669 L4_MABX_B.RawData_i[1] = L4_MABX_B.DataTypeConversion1_nu;
21670 L4_MABX_B.RawData_i[2] = L4_MABX_B.DataTypeConversion2_m5;
21671 L4_MABX_B.RawData_i[3] = L4_MABX_B.DataTypeConversion3_by;
21672 L4_MABX_B.RawData_i[4] = L4_MABX_B.DataTypeConversion4_fl;
21673 L4_MABX_B.RawData_i[5] = L4_MABX_B.DataTypeConversion5_gi;
21674 L4_MABX_B.RawData_i[6] = L4_MABX_B.DataTypeConversion6_af;
21675 L4_MABX_B.RawData_i[7] = L4_MABX_B.DataTypeConversion7_j;
21676 break;
21677
21678 case ENUM_CAN_RX_T_RX_CAN_3:
21679 L4_MABX_B.RawData_i[0] = L4_MABX_B.DataTypeConversion_gt;
21680 L4_MABX_B.RawData_i[1] = L4_MABX_B.DataTypeConversion1_evi;
21681 L4_MABX_B.RawData_i[2] = L4_MABX_B.DataTypeConversion2_lr;
21682 L4_MABX_B.RawData_i[3] = L4_MABX_B.DataTypeConversion3_a3;
21683 L4_MABX_B.RawData_i[4] = L4_MABX_B.DataTypeConversion4_it;
21684 L4_MABX_B.RawData_i[5] = L4_MABX_B.DataTypeConversion5_nf;
21685 L4_MABX_B.RawData_i[6] = L4_MABX_B.DataTypeConversion6_l;
21686 L4_MABX_B.RawData_i[7] = L4_MABX_B.DataTypeConversion7_p;
21687 break;
21688
21689 case ENUM_CAN_RX_T_RX_CAN_4:
21690 L4_MABX_B.RawData_i[0] = L4_MABX_B.DataTypeConversion_gt;
21691 L4_MABX_B.RawData_i[1] = L4_MABX_B.DataTypeConversion1_evi;
21692 L4_MABX_B.RawData_i[2] = L4_MABX_B.DataTypeConversion2_lr;
21693 L4_MABX_B.RawData_i[3] = L4_MABX_B.DataTypeConversion3_a3;
21694 L4_MABX_B.RawData_i[4] = L4_MABX_B.DataTypeConversion4_it;
21695 L4_MABX_B.RawData_i[5] = L4_MABX_B.DataTypeConversion5_nf;
21696 L4_MABX_B.RawData_i[6] = L4_MABX_B.DataTypeConversion6_l;
21697 L4_MABX_B.RawData_i[7] = L4_MABX_B.DataTypeConversion7_p;
21698 break;
21699
21700 case ENUM_CAN_RX_T_RX_CAN_5:
21701 L4_MABX_B.RawData_i[0] = L4_MABX_B.DataTypeConversion_gt;
21702 L4_MABX_B.RawData_i[1] = L4_MABX_B.DataTypeConversion1_evi;
21703 L4_MABX_B.RawData_i[2] = L4_MABX_B.DataTypeConversion2_lr;
21704 L4_MABX_B.RawData_i[3] = L4_MABX_B.DataTypeConversion3_a3;
21705 L4_MABX_B.RawData_i[4] = L4_MABX_B.DataTypeConversion4_it;
21706 L4_MABX_B.RawData_i[5] = L4_MABX_B.DataTypeConversion5_nf;
21707 L4_MABX_B.RawData_i[6] = L4_MABX_B.DataTypeConversion6_l;
21708 L4_MABX_B.RawData_i[7] = L4_MABX_B.DataTypeConversion7_p;
21709 break;
21710
21711 case ENUM_CAN_RX_T_RX_CAN_6:
21712 L4_MABX_B.RawData_i[0] = L4_MABX_B.DataTypeConversion_gt;
21713 L4_MABX_B.RawData_i[1] = L4_MABX_B.DataTypeConversion1_evi;
21714 L4_MABX_B.RawData_i[2] = L4_MABX_B.DataTypeConversion2_lr;
21715 L4_MABX_B.RawData_i[3] = L4_MABX_B.DataTypeConversion3_a3;
21716 L4_MABX_B.RawData_i[4] = L4_MABX_B.DataTypeConversion4_it;
21717 L4_MABX_B.RawData_i[5] = L4_MABX_B.DataTypeConversion5_nf;
21718 L4_MABX_B.RawData_i[6] = L4_MABX_B.DataTypeConversion6_l;
21719 L4_MABX_B.RawData_i[7] = L4_MABX_B.DataTypeConversion7_p;
21720 break;
21721
21722 default:
21723 L4_MABX_B.RawData_i[0] = L4_MABX_B.DataTypeConversion_gt;
21724 L4_MABX_B.RawData_i[1] = L4_MABX_B.DataTypeConversion1_evi;
21725 L4_MABX_B.RawData_i[2] = L4_MABX_B.DataTypeConversion2_lr;
21726 L4_MABX_B.RawData_i[3] = L4_MABX_B.DataTypeConversion3_a3;
21727 L4_MABX_B.RawData_i[4] = L4_MABX_B.DataTypeConversion4_it;
21728 L4_MABX_B.RawData_i[5] = L4_MABX_B.DataTypeConversion5_nf;
21729 L4_MABX_B.RawData_i[6] = L4_MABX_B.DataTypeConversion6_l;
21730 L4_MABX_B.RawData_i[7] = L4_MABX_B.DataTypeConversion7_p;
21731 break;
21732 }
21733
21734 /* S-Function (sfix_bitop): '<S684>/Operator' */
21735 L4_MABX_B.Operator_fu = (uint8_T)(L4_MABX_B.RawData_i[0] &
21736 L4_MABX_P.Operator_BitMask_lp);
21737
21738 /* DataTypeConversion: '<S684>/DataType' */
21739 L4_MABX_B.DataType_fsx = L4_MABX_B.Operator_fu;
21740
21741 /* ArithShift: '<S677>/Shift_Arithmetic ' */
21742 L4_MABX_B.Shift_Arithmetic_pw = (uint8_T)((uint32_T)L4_MABX_B.DataType_fsx >>
21743 1);
21744
21745 /* DataTypeConversion: '<S677>/Data Type Conversion' */
21746 L4_MABX_B.PropB_REAX_4_PositionIndexValid = (L4_MABX_B.Shift_Arithmetic_pw !=
21747 0);
21748
21749 /* DataTypeConversion: '<S420>/Data Type Conversion' */
21750 L4_MABX_B.DataTypeConversion_f0 = L4_MABX_B.PropB_REAX_4_PositionIndexValid;
21751
21752 /* S-Function (sfix_bitop): '<S683>/Operator' */
21753 L4_MABX_B.Operator_gz = (uint8_T)(L4_MABX_B.RawData_i[0] &
21754 L4_MABX_P.Operator_BitMask_ia);
21755
21756 /* DataTypeConversion: '<S683>/DataType' */
21757 L4_MABX_B.DataType_f1 = (L4_MABX_B.Operator_gz != 0);
21758
21759 /* DataTypeConversion: '<S420>/Data Type Conversion1' */
21760 L4_MABX_B.DataTypeConversion1_cya = L4_MABX_B.DataType_f1;
21761
21762 /* S-Function (sfix_bitop): '<S685>/Operator' */
21763 L4_MABX_B.Operator_at = (uint8_T)(L4_MABX_B.RawData_i[0] &
21764 L4_MABX_P.Operator_BitMask_ah);
21765
21766 /* DataTypeConversion: '<S685>/DataType' */
21767 L4_MABX_B.DataType_on = L4_MABX_B.Operator_at;
21768
21769 /* ArithShift: '<S677>/Shift_Arithmetic 1' */
21770 L4_MABX_B.Shift_Arithmetic1_pr = (uint8_T)((uint32_T)L4_MABX_B.DataType_on >>
21771 2);
21772
21773 /* DataTypeConversion: '<S677>/Data Type Conversion1' */
21774 L4_MABX_B.PropB_REAX_4_DriverControlledEf = (L4_MABX_B.Shift_Arithmetic1_pr !=
21775 0);
21776
21777 /* DataTypeConversion: '<S420>/Data Type Conversion2' */
21778 L4_MABX_B.DataTypeConversion2_ag = L4_MABX_B.PropB_REAX_4_DriverControlledEf;
21779
21780 /* SignalConversion: '<S678>/SignalConversion' */
21781 L4_MABX_B.PropB_REAX_4_ControlOperatingMo = L4_MABX_B.RawData_i[1];
21782
21783 /* DataTypeConversion: '<S420>/Data Type Conversion3' */
21784 L4_MABX_B.DataTypeConversion3_c1 = L4_MABX_B.PropB_REAX_4_ControlOperatingMo;
21785
21786 /* SignalConversion: '<S679>/SignalConversion' */
21787 L4_MABX_B.PropB_REAX_4_SystemMode = L4_MABX_B.RawData_i[2];
21788
21789 /* DataTypeConversion: '<S420>/Data Type Conversion4' */
21790 L4_MABX_B.DataTypeConversion4_li = L4_MABX_B.PropB_REAX_4_SystemMode;
21791
21792 /* DataTypeConversion: '<S680>/Data Type Conversion4' */
21793 L4_MABX_B.DataTypeConversion4_iy = (int8_T)L4_MABX_B.RawData_i[4];
21794
21795 /* DataTypeConversion: '<S680>/Data Type Conversion5' */
21796 L4_MABX_B.PropB_REAX_4_PercHandwheelTorqu = L4_MABX_B.DataTypeConversion4_iy;
21797
21798 /* DataTypeConversion: '<S420>/Data Type Conversion5' */
21799 L4_MABX_B.DataTypeConversion5_j = L4_MABX_B.PropB_REAX_4_PercHandwheelTorqu;
21800
21801 /* DataTypeConversion: '<S681>/Data Type Conversion6' */
21802 L4_MABX_B.DataTypeConversion6_f1 = L4_MABX_B.RawData_i[5];
21803
21804 /* DataTypeConversion: '<S681>/Data Type Conversion7' */
21805 L4_MABX_B.DataTypeConversion7_bo = L4_MABX_B.RawData_i[6];
21806
21807 /* ArithShift: '<S681>/Shift_Arithmetic 2' */
21808 L4_MABX_B.Shift_Arithmetic2_j = (uint16_T)(L4_MABX_B.DataTypeConversion7_bo <<
21809 8);
21810
21811 /* S-Function (sfix_bitop): '<S686>/Operator' */
21812 L4_MABX_B.Operator_l = (uint16_T)(L4_MABX_B.DataTypeConversion6_f1 |
21813 L4_MABX_B.Shift_Arithmetic2_j);
21814
21815 /* DataTypeConversion: '<S686>/DataType' */
21816 L4_MABX_B.DataType_lc = L4_MABX_B.Operator_l;
21817
21818 /* DataTypeConversion: '<S681>/Data Type Conversion8' */
21819 L4_MABX_B.DataTypeConversion8_a3 = (int16_T)L4_MABX_B.DataType_lc;
21820
21821 /* DataTypeConversion: '<S681>/Data Type Conversion9' */
21822 L4_MABX_B.PropB_REAX_4_AbsSteeringAngle = L4_MABX_B.DataTypeConversion8_a3;
21823
21824 /* DataTypeConversion: '<S420>/Data Type Conversion6' */
21825 L4_MABX_B.DataTypeConversion6_a = L4_MABX_B.PropB_REAX_4_AbsSteeringAngle;
21826
21827 /* DataTypeConversion: '<S682>/Data Type Conversion10' */
21828 L4_MABX_B.DataTypeConversion10_h = (int8_T)L4_MABX_B.RawData_i[7];
21829
21830 /* DataTypeConversion: '<S682>/Data Type Conversion11' */
21831 L4_MABX_B.PropB_REAX_4_PercMotorTorque = L4_MABX_B.DataTypeConversion10_h;
21832
21833 /* DataTypeConversion: '<S420>/Data Type Conversion7' */
21834 L4_MABX_B.DataTypeConversion7_g = L4_MABX_B.PropB_REAX_4_PercMotorTorque;
21835
21836 /* DataTypeConversion: '<S597>/Data Type Conversion8' */
21837 L4_MABX_B.RX_status_jg = (L4_MABX_B.SFunction1_o9_ch != 0.0);
21838
21839 /* MultiPortSwitch: '<S445>/Multiport_Switch' incorporates:
21840 * Constant: '<S445>/Constant'
21841 */
21842 switch (PROPB_REAX_CHANNEL_APV) {
21843 case ENUM_CAN_RX_T_RX_CAN_1:
21844 /* DataTypeConversion: '<S595>/Data Type Conversion8' */
21845 L4_MABX_B.RX_status_kh = (L4_MABX_B.SFunction1_o9_ii != 0.0);
21846 L4_MABX_B.RX_status_is = L4_MABX_B.RX_status_kh;
21847 break;
21848
21849 case ENUM_CAN_RX_T_RX_CAN_2:
21850 /* DataTypeConversion: '<S596>/Data Type Conversion8' */
21851 L4_MABX_B.RX_status_d5q = (L4_MABX_B.SFunction1_o9_h != 0.0);
21852 L4_MABX_B.RX_status_is = L4_MABX_B.RX_status_d5q;
21853 break;
21854
21855 case ENUM_CAN_RX_T_RX_CAN_3:
21856 L4_MABX_B.RX_status_is = L4_MABX_B.RX_status_jg;
21857 break;
21858
21859 case ENUM_CAN_RX_T_RX_CAN_4:
21860 L4_MABX_B.RX_status_is = L4_MABX_B.RX_status_jg;
21861 break;
21862
21863 case ENUM_CAN_RX_T_RX_CAN_5:
21864 L4_MABX_B.RX_status_is = L4_MABX_B.RX_status_jg;
21865 break;
21866
21867 case ENUM_CAN_RX_T_RX_CAN_6:
21868 L4_MABX_B.RX_status_is = L4_MABX_B.RX_status_jg;
21869 break;
21870
21871 default:
21872 L4_MABX_B.RX_status_is = L4_MABX_B.RX_status_jg;
21873 break;
21874 }
21875
21876 /* DataTypeConversion: '<S597>/Data Type Conversion9' */
21877 L4_MABX_B.RX_time_pn = L4_MABX_B.SFunction1_o10_p;
21878
21879 /* MultiPortSwitch: '<S445>/Multiport_Switch' incorporates:
21880 * Constant: '<S445>/Constant'
21881 */
21882 switch (PROPB_REAX_CHANNEL_APV) {
21883 case ENUM_CAN_RX_T_RX_CAN_1:
21884 /* DataTypeConversion: '<S595>/Data Type Conversion9' */
21885 L4_MABX_B.RX_time_bw = L4_MABX_B.SFunction1_o10_d;
21886 L4_MABX_B.RX_time_mv = L4_MABX_B.RX_time_bw;
21887 break;
21888
21889 case ENUM_CAN_RX_T_RX_CAN_2:
21890 /* DataTypeConversion: '<S596>/Data Type Conversion9' */
21891 L4_MABX_B.RX_time_kc = L4_MABX_B.SFunction1_o10_e;
21892 L4_MABX_B.RX_time_mv = L4_MABX_B.RX_time_kc;
21893 break;
21894
21895 case ENUM_CAN_RX_T_RX_CAN_3:
21896 L4_MABX_B.RX_time_mv = L4_MABX_B.RX_time_pn;
21897 break;
21898
21899 case ENUM_CAN_RX_T_RX_CAN_4:
21900 L4_MABX_B.RX_time_mv = L4_MABX_B.RX_time_pn;
21901 break;
21902
21903 case ENUM_CAN_RX_T_RX_CAN_5:
21904 L4_MABX_B.RX_time_mv = L4_MABX_B.RX_time_pn;
21905 break;
21906
21907 case ENUM_CAN_RX_T_RX_CAN_6:
21908 L4_MABX_B.RX_time_mv = L4_MABX_B.RX_time_pn;
21909 break;
21910
21911 default:
21912 L4_MABX_B.RX_time_mv = L4_MABX_B.RX_time_pn;
21913 break;
21914 }
21915
21916 /* DataTypeConversion: '<S597>/Data Type Conversion10' */
21917 L4_MABX_B.RX_delta_time_p = L4_MABX_B.SFunction1_o11_a;
21918
21919 /* MultiPortSwitch: '<S445>/Multiport_Switch' incorporates:
21920 * Constant: '<S445>/Constant'
21921 */
21922 switch (PROPB_REAX_CHANNEL_APV) {
21923 case ENUM_CAN_RX_T_RX_CAN_1:
21924 /* DataTypeConversion: '<S595>/Data Type Conversion10' */
21925 L4_MABX_B.RX_delta_time_ia = L4_MABX_B.SFunction1_o11_m;
21926 L4_MABX_B.RX_delta_time_db = L4_MABX_B.RX_delta_time_ia;
21927 break;
21928
21929 case ENUM_CAN_RX_T_RX_CAN_2:
21930 /* DataTypeConversion: '<S596>/Data Type Conversion10' */
21931 L4_MABX_B.RX_delta_time_ls = L4_MABX_B.SFunction1_o11_c;
21932 L4_MABX_B.RX_delta_time_db = L4_MABX_B.RX_delta_time_ls;
21933 break;
21934
21935 case ENUM_CAN_RX_T_RX_CAN_3:
21936 L4_MABX_B.RX_delta_time_db = L4_MABX_B.RX_delta_time_p;
21937 break;
21938
21939 case ENUM_CAN_RX_T_RX_CAN_4:
21940 L4_MABX_B.RX_delta_time_db = L4_MABX_B.RX_delta_time_p;
21941 break;
21942
21943 case ENUM_CAN_RX_T_RX_CAN_5:
21944 L4_MABX_B.RX_delta_time_db = L4_MABX_B.RX_delta_time_p;
21945 break;
21946
21947 case ENUM_CAN_RX_T_RX_CAN_6:
21948 L4_MABX_B.RX_delta_time_db = L4_MABX_B.RX_delta_time_p;
21949 break;
21950
21951 default:
21952 L4_MABX_B.RX_delta_time_db = L4_MABX_B.RX_delta_time_p;
21953 break;
21954 }
21955
21956 /* RelationalOperator: '<S604>/Operator' incorporates:
21957 * Constant: '<S445>/Constant'
21958 * Constant: '<S598>/Constant2'
21959 */
21960 L4_MABX_B.Operator_eq = (PROPB_REAX_CHANNEL_APV ==
21961 L4_MABX_P.Constant2_Value_ow);
21962
21963 /* RelationalOperator: '<S605>/Operator' incorporates:
21964 * Constant: '<S445>/Constant'
21965 * Constant: '<S598>/Constant3'
21966 */
21967 L4_MABX_B.Operator_ac = (PROPB_REAX_CHANNEL_APV == L4_MABX_P.Constant3_Value_h);
21968
21969 /* RelationalOperator: '<S606>/Operator' incorporates:
21970 * Constant: '<S445>/Constant'
21971 * Constant: '<S598>/Constant4'
21972 */
21973 L4_MABX_B.Operator_e4m = (PROPB_REAX_CHANNEL_APV ==
21974 L4_MABX_P.Constant4_Value_kk);
21975
21976 /* S-Function (rti_commonblock): '<S460>/S-Function1' */
21977 /* This comment workarounds a code generation problem */
21978
21979 /* S-Function (rti_commonblock): '<S461>/S-Function1' */
21980 /* This comment workarounds a code generation problem */
21981
21982 /* S-Function (rti_commonblock): '<S462>/S-Function1' */
21983 /* This comment workarounds a code generation problem */
21984
21985 /* S-Function (rti_commonblock): '<S463>/S-Function1' */
21986 /* This comment workarounds a code generation problem */
21987
21988 /* S-Function (rti_commonblock): '<S464>/S-Function1' */
21989 /* This comment workarounds a code generation problem */
21990
21991 /* S-Function (rti_commonblock): '<S465>/S-Function1' */
21992 /* This comment workarounds a code generation problem */
21993
21994 /* S-Function (rti_commonblock): '<S737>/S-Function1' */
21995 /* This comment workarounds a code generation problem */
21996
21997 /* DataTypeConversion: '<S416>/LogPbActive' */
21998 L4_MABX_B.LogPbActive = L4_MABX_B.SFunction1_a;
21999
22000 /* Logic: '<S416>/Logical Operator2' */
22001 L4_MABX_B.LogicalOperator2_o = !L4_MABX_B.LogPbActive;
22002
22003 /* RelationalOperator: '<S751>/Compare' incorporates:
22004 * Constant: '<S751>/Constant'
22005 */
22006 L4_MABX_B.Compare_ng = ((int32_T)L4_MABX_B.LogicalOperator2_o > (int32_T)
22007 L4_MABX_P.Constant_Value_j1);
22008
22009 /* UnitDelay: '<S747>/Delay Input1' */
22010 L4_MABX_B.Uk1_h = L4_MABX_DW.DelayInput1_DSTATE_o;
22011
22012 /* RelationalOperator: '<S747>/FixPt Relational Operator' */
22013 L4_MABX_B.FixPtRelationalOperator_d = ((int32_T)L4_MABX_B.Compare_ng >
22014 (int32_T)L4_MABX_B.Uk1_h);
22015
22016 /* UnitDelay: '<S748>/Unit Delay' */
22017 L4_MABX_B.UnitDelay_m = L4_MABX_DW.UnitDelay_DSTATE_e;
22018
22019 /* UnitDelay: '<S742>/Unit Delay' */
22020 L4_MABX_B.UnitDelay_m3 = L4_MABX_DW.UnitDelay_DSTATE_dy;
22021
22022 /* RelationalOperator: '<S750>/Compare' incorporates:
22023 * Constant: '<S750>/Constant'
22024 */
22025 L4_MABX_B.Compare_bv = ((int32_T)L4_MABX_B.UnitDelay_m3 <= (int32_T)
22026 L4_MABX_P.Constant_Value_eb);
22027
22028 /* UnitDelay: '<S746>/Delay Input1' */
22029 L4_MABX_B.Uk1_a = L4_MABX_DW.DelayInput1_DSTATE_h;
22030
22031 /* RelationalOperator: '<S746>/FixPt Relational Operator' */
22032 L4_MABX_B.FixPtRelationalOperator_n = ((int32_T)L4_MABX_B.Compare_bv >
22033 (int32_T)L4_MABX_B.Uk1_a);
22034
22035 /* UnitDelay: '<S748>/Unit Delay1' */
22036 L4_MABX_B.UnitDelay1_em = L4_MABX_DW.UnitDelay1_DSTATE_c;
22037
22038 /* Logic: '<S748>/OR1' */
22039 L4_MABX_B.OR1_e = (L4_MABX_B.FixPtRelationalOperator_n ||
22040 L4_MABX_B.UnitDelay1_em);
22041
22042 /* Switch: '<S748>/Switch' incorporates:
22043 * Constant: '<S748>/Constant0'
22044 */
22045 if (L4_MABX_B.OR1_e) {
22046 /* Sum: '<S748>/Sum' incorporates:
22047 * Constant: '<S748>/Constant1'
22048 */
22049 L4_MABX_B.Sum_o = L4_MABX_B.UnitDelay_m + L4_MABX_P.Constant1_Value_e0;
22050 L4_MABX_B.Switch_f = L4_MABX_B.Sum_o;
22051 } else {
22052 L4_MABX_B.Switch_f = L4_MABX_P.Constant0_Value_n;
22053 }
22054
22055 /* End of Switch: '<S748>/Switch' */
22056
22057 /* RelationalOperator: '<S752>/Compare' incorporates:
22058 * Constant: '<S752>/Constant'
22059 */
22060 L4_MABX_B.Compare_m = (L4_MABX_B.Switch_f > L4_MABX_P.Constant_Value_g4);
22061
22062 /* Gain: '<S748>/Gain' incorporates:
22063 * Constant: '<S416>/Constant1'
22064 */
22065 L4_MABX_B.Gain_b = L4_MABX_P.Gain_Gain_gr * L4_MABX_P.Constant1_Value_cv;
22066
22067 /* RelationalOperator: '<S748>/LessThanOrEqual' */
22068 L4_MABX_B.LessThanOrEqual_a = (L4_MABX_B.Switch_f <= L4_MABX_B.Gain_b);
22069
22070 /* Logic: '<S748>/AND' */
22071 L4_MABX_B.AND_d = (L4_MABX_B.Compare_m && L4_MABX_B.LessThanOrEqual_a);
22072
22073 /* Logic: '<S742>/NOT' */
22074 L4_MABX_B.NOT_l = !L4_MABX_B.AND_d;
22075
22076 /* Logic: '<S742>/AND' */
22077 L4_MABX_B.AND_j = (L4_MABX_B.FixPtRelationalOperator_d && L4_MABX_B.NOT_l);
22078
22079 /* UnitDelay: '<S749>/Unit Delay' */
22080 L4_MABX_B.UnitDelay_b = L4_MABX_DW.UnitDelay_DSTATE_j;
22081
22082 /* UnitDelay: '<S749>/Unit Delay1' */
22083 L4_MABX_B.UnitDelay1_ef = L4_MABX_DW.UnitDelay1_DSTATE_c2;
22084
22085 /* Logic: '<S749>/OR1' */
22086 L4_MABX_B.OR1_h = (L4_MABX_B.AND_j || L4_MABX_B.UnitDelay1_ef);
22087
22088 /* Switch: '<S749>/Switch' incorporates:
22089 * Constant: '<S749>/Constant0'
22090 */
22091 if (L4_MABX_B.OR1_h) {
22092 /* Sum: '<S749>/Sum' incorporates:
22093 * Constant: '<S749>/Constant1'
22094 */
22095 L4_MABX_B.Sum_d = L4_MABX_B.UnitDelay_b + L4_MABX_P.Constant1_Value_f0;
22096 L4_MABX_B.Switch_b = L4_MABX_B.Sum_d;
22097 } else {
22098 L4_MABX_B.Switch_b = L4_MABX_P.Constant0_Value_k;
22099 }
22100
22101 /* End of Switch: '<S749>/Switch' */
22102
22103 /* RelationalOperator: '<S753>/Compare' incorporates:
22104 * Constant: '<S753>/Constant'
22105 */
22106 L4_MABX_B.Compare_p = (L4_MABX_B.Switch_b > L4_MABX_P.Constant_Value_kq);
22107
22108 /* Gain: '<S749>/Gain' incorporates:
22109 * Constant: '<S416>/Constant'
22110 */
22111 L4_MABX_B.Gain_br = L4_MABX_P.Gain_Gain_li * L4_MABX_P.Constant_Value_fya;
22112
22113 /* RelationalOperator: '<S749>/LessThanOrEqual' */
22114 L4_MABX_B.LessThanOrEqual_d = (L4_MABX_B.Switch_b <= L4_MABX_B.Gain_br);
22115
22116 /* Logic: '<S749>/AND' */
22117 L4_MABX_B.AND_e = (L4_MABX_B.Compare_p && L4_MABX_B.LessThanOrEqual_d);
22118
22119 /* Logic: '<S742>/AND2' */
22120 LogEventPB = (L4_MABX_B.AND_e && L4_MABX_B.NOT_l);
22121
22122 /* Assertion: '<S783>/Assertion' */
22123 utAssert(L4_MABX_B.conjunction_l);
22124
22125 /* Assertion: '<S791>/Assertion' */
22126 utAssert(L4_MABX_B.conjunction);
22127
22128 /* Assertion: '<S799>/Assertion' */
22129 utAssert(L4_MABX_B.conjunction_g);
22130
22131 /* Assertion: '<S807>/Assertion' */
22132 utAssert(L4_MABX_B.conjunction_m);
22133
22134 /* Assertion: '<S815>/Assertion' */
22135 utAssert(L4_MABX_B.conjunction_b);
22136
22137 /* RelationalOperator: '<S782>/Relational Operator9' incorporates:
22138 * Constant: '<S763>/PWMSynchFaultLimMin'
22139 */
22140 L4_MABX_B.F_Fault_Soft_b = (L4_MABX_B.If_Then_Else_d.Switch !=
22141 L4_MABX_P.PWMSynchFaultLimMin_Value);
22142
22143 /* Gain: '<S416>/ShifterControlFreq' */
22144 L4_MABX_B.ShiftControlFreq = L4_MABX_P.ShifterControlFreq_Gain *
22145 L4_MABX_B.SFunction1_o1_e;
22146
22147 /* S-Function (rti_commonblock): '<S730>/S-Function1' */
22148 /* This comment workarounds a code generation problem */
22149 {
22150 /* dSPACE I/O Board DS1401STDADCT4 #1 Unit:ADC Group:ADC */
22151 adc_tp4_single_new_read(ADC_TP4_1_MODULE_ADDR,
22152 ADC_TP4_CH2,
22153 (dsfloat *)&L4_MABX_B.SFunction1_e);
22154 }
22155
22156 /* Gain: '<S416>/ShifterControlDC2' */
22157 L4_MABX_B.ShifterControlDC2 = L4_MABX_P.ShifterControlDC2_Gain *
22158 L4_MABX_B.SFunction1_e;
22159
22160 /* S-Function (rti_commonblock): '<S731>/S-Function1' */
22161 /* This comment workarounds a code generation problem */
22162 {
22163 /* dSPACE I/O Board DS1401STDADCT4 #1 Unit:ADC Group:ADC */
22164 adc_tp4_single_new_read(ADC_TP4_1_MODULE_ADDR,
22165 ADC_TP4_CH1,
22166 (dsfloat *)&L4_MABX_B.SFunction1_f);
22167 }
22168
22169 /* Gain: '<S416>/ShifterControlDC1' */
22170 L4_MABX_B.ShifterControlDC1 = L4_MABX_P.ShifterControlDC1_Gain *
22171 L4_MABX_B.SFunction1_f;
22172
22173 /* S-Function (rti_commonblock): '<S8>/S-Function1' */
22174 /* This comment workarounds a code generation problem */
22175
22176 /* S-Function (rti_commonblock): '<S9>/S-Function1' */
22177 /* This comment workarounds a code generation problem */
22178
22179 /* UnitDelay: '<S10>/Unit_Delay' */
22180 L4_MABX_B.Unit_Delay_jj = L4_MABX_DW.Unit_Delay_DSTATE_do;
22181
22182 /* Outputs for Enabled SubSystem: '<S10>/EnabledSubsystem' incorporates:
22183 * EnablePort: '<S1090>/Enable'
22184 */
22185 if (L4_MABX_B.Unit_Delay_jj) {
22186 /* Constant: '<S1090>/Constant' */
22187 memcpy(&GLB_SWVERSION_CPV_[0], &L4_MABX_P.GLB_SWVERSION_CPV[0], 100U *
22188 sizeof(uint8_T));
22189 }
22190
22191 /* End of Outputs for SubSystem: '<S10>/EnabledSubsystem' */
22192 /* user code (Output function Trailer for TID0) */
22193
22194 /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */
22195 /* EventChannel: 0 */
22196 if (tid == 0) {
22197 DSXCP_service(0);
22198 }
22199
22200 /* If subsystem generates rate grouping Output functions,
22201 * when tid is used in Output function for one rate,
22202 * all Output functions include tid as a local variable.
22203 * As result, some Output functions may have unused tid.
22204 */
22205 UNUSED_PARAMETER(tid);
22206}
22207
22208/* Model update function for TID0 */
22209void L4_MABX_update0(void) /* Sample time: [0.01s, 0.0s] */
22210{
22211 int32_T i;
22212
22213 /* Update for UnitDelay: '<S757>/Unit Delay' */
22214 L4_MABX_DW.UnitDelay_DSTATE = L4_MABX_B.Switch_e;
22215
22216 /* Update for UnitDelay: '<S755>/Delay Input1' */
22217 L4_MABX_DW.DelayInput1_DSTATE_n = L4_MABX_B.Compare;
22218
22219 /* Update for UnitDelay: '<S756>/Unit Delay' */
22220 L4_MABX_DW.UnitDelay_DSTATE_m = L4_MABX_B.Switch;
22221
22222 /* Update for UnitDelay: '<S743>/Unit Delay' */
22223 L4_MABX_DW.UnitDelay_DSTATE_o = L4_MABX_B.AND_p;
22224
22225 /* Update for UnitDelay: '<S754>/Delay Input1' */
22226 L4_MABX_DW.DelayInput1_DSTATE_p = L4_MABX_B.Compare_j;
22227
22228 /* Update for UnitDelay: '<S756>/Unit Delay1' */
22229 L4_MABX_DW.UnitDelay1_DSTATE_kw = L4_MABX_B.AND;
22230
22231 /* Update for UnitDelay: '<S757>/Unit Delay1' */
22232 L4_MABX_DW.UnitDelay1_DSTATE_b = L4_MABX_B.AND_p;
22233
22234 /* Update for UnitDelay: '<S796>/FixPt Unit Delay2' incorporates:
22235 * Constant: '<S796>/FixPt Constant'
22236 */
22237 L4_MABX_DW.FixPtUnitDelay2_DSTATE = L4_MABX_P.FixPtConstant_Value_kn;
22238
22239 /* Update for UnitDelay: '<S796>/FixPt Unit Delay1' */
22240 L4_MABX_DW.FixPtUnitDelay1_DSTATE = L4_MABX_B.If_Then_Else_i.Switch;
22241
22242 /* Update for UnitDelay: '<S788>/FixPt Unit Delay2' incorporates:
22243 * Constant: '<S788>/FixPt Constant'
22244 */
22245 L4_MABX_DW.FixPtUnitDelay2_DSTATE_i = L4_MABX_P.FixPtConstant_Value_k5;
22246
22247 /* Update for UnitDelay: '<S788>/FixPt Unit Delay1' */
22248 L4_MABX_DW.FixPtUnitDelay1_DSTATE_p = L4_MABX_B.If_Then_Else_c.Switch;
22249
22250 /* Update for UnitDelay: '<S812>/FixPt Unit Delay2' incorporates:
22251 * Constant: '<S812>/FixPt Constant'
22252 */
22253 L4_MABX_DW.FixPtUnitDelay2_DSTATE_o = L4_MABX_P.FixPtConstant_Value_fu;
22254
22255 /* Update for UnitDelay: '<S812>/FixPt Unit Delay1' */
22256 L4_MABX_DW.FixPtUnitDelay1_DSTATE_h = L4_MABX_B.If_Then_Else_g.Switch;
22257
22258 /* Update for UnitDelay: '<S804>/FixPt Unit Delay2' incorporates:
22259 * Constant: '<S804>/FixPt Constant'
22260 */
22261 L4_MABX_DW.FixPtUnitDelay2_DSTATE_k = L4_MABX_P.FixPtConstant_Value_em;
22262
22263 /* Update for UnitDelay: '<S804>/FixPt Unit Delay1' */
22264 L4_MABX_DW.FixPtUnitDelay1_DSTATE_h3 = L4_MABX_B.If_Then_Else_m.Switch;
22265
22266 /* Update for UnitDelay: '<S766>/Unit_Delay' incorporates:
22267 * Constant: '<S766>/Constant'
22268 */
22269 L4_MABX_DW.Unit_Delay_DSTATE_h2 = L4_MABX_P.Constant_Value_ebv;
22270
22271 /* Update for UnitDelay: '<S833>/Unit_Delay1' incorporates:
22272 * Constant: '<S833>/Constant'
22273 */
22274 L4_MABX_DW.Unit_Delay1_DSTATE = L4_MABX_P.Constant_Value_dd;
22275
22276 /* Update for UnitDelay: '<S833>/Unit_Delay2' */
22277 L4_MABX_DW.Unit_Delay2_DSTATE = L4_MABX_B.If_Then_Else_mz.Switch;
22278
22279 /* Update for UnitDelay: '<S766>/Unit_Delay1' incorporates:
22280 * Constant: '<S766>/Constant1'
22281 */
22282 L4_MABX_DW.Unit_Delay1_DSTATE_m = L4_MABX_P.Constant1_Value_fi;
22283
22284 /* Update for UnitDelay: '<S834>/Unit_Delay1' incorporates:
22285 * Constant: '<S834>/Constant'
22286 */
22287 L4_MABX_DW.Unit_Delay1_DSTATE_j = L4_MABX_P.Constant_Value_dg;
22288
22289 /* Update for UnitDelay: '<S834>/Unit_Delay2' */
22290 L4_MABX_DW.Unit_Delay2_DSTATE_b = L4_MABX_B.If_Then_Else_dt.Switch;
22291
22292 /* Update for UnitDelay: '<S832>/FixPt Unit Delay2' incorporates:
22293 * Constant: '<S832>/FixPt Constant'
22294 */
22295 L4_MABX_DW.FixPtUnitDelay2_DSTATE_ie = L4_MABX_P.FixPtConstant_Value_i;
22296
22297 /* Update for UnitDelay: '<S832>/FixPt Unit Delay1' */
22298 L4_MABX_DW.FixPtUnitDelay1_DSTATE_o = L4_MABX_B.If_Then_Else3_i.Switch;
22299
22300 /* Update for UnitDelay: '<S831>/FixPt Unit Delay2' incorporates:
22301 * Constant: '<S831>/FixPt Constant'
22302 */
22303 L4_MABX_DW.FixPtUnitDelay2_DSTATE_iv = L4_MABX_P.FixPtConstant_Value_px;
22304
22305 /* Update for UnitDelay: '<S831>/FixPt Unit Delay1' */
22306 L4_MABX_DW.FixPtUnitDelay1_DSTATE_i = L4_MABX_B.If_Then_Else1_ln.Switch;
22307
22308 /* Update for UnitDelay: '<S820>/FixPt Unit Delay2' incorporates:
22309 * Constant: '<S820>/FixPt Constant'
22310 */
22311 L4_MABX_DW.FixPtUnitDelay2_DSTATE_b = L4_MABX_P.FixPtConstant_Value_o;
22312
22313 /* Update for UnitDelay: '<S820>/FixPt Unit Delay1' */
22314 L4_MABX_DW.FixPtUnitDelay1_DSTATE_e = L4_MABX_B.If_Then_Else_d.Switch;
22315
22316 /* Update for Enabled SubSystem: '<S744>/Slew_at_event' incorporates:
22317 * EnablePort: '<S767>/Enable'
22318 */
22319 if (L4_MABX_DW.Slew_at_event_MODE) {
22320 /* Update for UnitDelay: '<S838>/Unit_Delay' */
22321 L4_MABX_DW.Unit_Delay_DSTATE_m5 = L4_MABX_B.LogicalOperator6_b;
22322
22323 /* Update for UnitDelay: '<S839>/Unit_Delay' incorporates:
22324 * Constant: '<S839>/Constant'
22325 */
22326 L4_MABX_DW.Unit_Delay_DSTATE_ep = L4_MABX_P.Constant_Value_cb;
22327
22328 /* Update for UnitDelay: '<S842>/FixPt Unit Delay2' incorporates:
22329 * Constant: '<S842>/FixPt Constant'
22330 */
22331 L4_MABX_DW.FixPtUnitDelay2_DSTATE_f = L4_MABX_P.FixPtConstant_Value_e0;
22332
22333 /* Update for UnitDelay: '<S842>/FixPt Unit Delay1' */
22334 L4_MABX_DW.FixPtUnitDelay1_DSTATE_b = L4_MABX_B.If_Then_Else_f1.Switch;
22335
22336 /* Update for UnitDelay: '<S837>/Unit_Delay' */
22337 L4_MABX_DW.Unit_Delay_DSTATE_cg = L4_MABX_B.LogicalOperator_b4;
22338 }
22339
22340 /* End of Update for SubSystem: '<S744>/Slew_at_event' */
22341
22342 /* Update for Enabled SubSystem: '<S436>/CAN_RX_EC1_00' incorporates:
22343 * EnablePort: '<S520>/Enable'
22344 */
22345 if (L4_MABX_B.LogicalOperator_n4) {
22346 /* Update for UnitDelay: '<S520>/Unit Delay' */
22347 for (i = 0; i < 39; i++) {
22348 L4_MABX_DW.UnitDelay_DSTATE_em[i] = L4_MABX_B.Data_i[i];
22349 }
22350
22351 /* End of Update for UnitDelay: '<S520>/Unit Delay' */
22352
22353 /* Update for Enabled SubSystem: '<S520>/Decode' incorporates:
22354 * EnablePort: '<S523>/Enable'
22355 */
22356 if (L4_MABX_B.RX_status_di) {
22357 /* Update for UnitDelay: '<S523>/Unit_Delay' */
22358 L4_MABX_DW.Unit_Delay_DSTATE_a = L4_MABX_B.timeStamp_c;
22359 }
22360
22361 /* End of Update for SubSystem: '<S520>/Decode' */
22362 }
22363
22364 /* End of Update for SubSystem: '<S436>/CAN_RX_EC1_00' */
22365
22366 /* Update for UnitDelay: '<S649>/Unit_Delay3' */
22367 L4_MABX_DW.Unit_Delay3_DSTATE = L4_MABX_B.LogicalOperator2_f;
22368
22369 /* Update for Enabled SubSystem: '<S459>/CAN_RX_VI_00' incorporates:
22370 * EnablePort: '<S648>/Enable'
22371 */
22372 if (L4_MABX_B.LogicalOperator_b) {
22373 /* Update for UnitDelay: '<S648>/Unit Delay' */
22374 for (i = 0; i < 17; i++) {
22375 L4_MABX_DW.UnitDelay_DSTATE_a[i] = L4_MABX_B.Data[i];
22376 }
22377
22378 /* End of Update for UnitDelay: '<S648>/Unit Delay' */
22379
22380 /* Update for Enabled SubSystem: '<S648>/Decode' incorporates:
22381 * EnablePort: '<S651>/Enable'
22382 */
22383 if (L4_MABX_B.RX_status_ez) {
22384 /* Update for UnitDelay: '<S651>/Unit_Delay' */
22385 L4_MABX_DW.Unit_Delay_DSTATE_e = L4_MABX_B.timeStamp;
22386 }
22387
22388 /* End of Update for SubSystem: '<S648>/Decode' */
22389 }
22390
22391 /* End of Update for SubSystem: '<S459>/CAN_RX_VI_00' */
22392
22393 /* Update for UnitDelay: '<S649>/Unit_Delay' incorporates:
22394 * Constant: '<S649>/Constant'
22395 */
22396 L4_MABX_DW.Unit_Delay_DSTATE_k = L4_MABX_P.Constant_Value_f1;
22397
22398 /* Update for UnitDelay: '<S655>/Unit_Delay' */
22399 L4_MABX_DW.Unit_Delay_DSTATE_dl = L4_MABX_B.LogicalOperator1_c;
22400
22401 /* Update for UnitDelay: '<S3>/Unit_Delay' */
22402 L4_MABX_DW.Unit_Delay_80_DSTATE = EStop;
22403 L4_MABX_DW.Unit_Delay_81_DSTATE = EnableSw;
22404 L4_MABX_DW.Unit_Delay_48_DSTATE = L4_MABX_B.AND_a;
22405 L4_MABX_DW.Unit_Delay_83_DSTATE = LogEventPB;
22406 L4_MABX_DW.Unit_Delay_45_DSTATE = L4_MABX_B.AutonomousEnabled_d;
22407 L4_MABX_DW.Unit_Delay_47_DSTATE = MABX_Mode;
22408 L4_MABX_DW.Unit_Delay_84_DSTATE = BrakeSW;
22409
22410 /* Update for UnitDelay: '<S405>/Delay Input1' */
22411 L4_MABX_DW.DelayInput1_DSTATE_np = L4_MABX_B.Compare_c5;
22412
22413 /* Update for UnitDelay: '<S403>/Unit Delay' */
22414 L4_MABX_DW.UnitDelay_DSTATE_k = L4_MABX_B.Count;
22415
22416 /* Update for Atomic SubSystem: '<S65>/Task_10ms' */
22417 /* Update for UnitDelay: '<S97>/Unit Delay1' */
22418 L4_MABX_DW.UnitDelay1_DSTATE_m = L4_MABX_B.Switch_a;
22419
22420 /* Update for UnitDelay: '<S76>/Unit_Delay' */
22421 L4_MABX_DW.Unit_Delay_DSTATE_fv = L4_MABX_B.AutonomousEnabled_d;
22422
22423 /* Update for UnitDelay: '<S98>/Delay Input1' */
22424 L4_MABX_DW.DelayInput1_DSTATE_d = L4_MABX_B.Compare_jp;
22425
22426 /* Update for UnitDelay: '<S97>/Unit Delay' */
22427 L4_MABX_DW.UnitDelay_DSTATE_b1 = L4_MABX_B.AND_f;
22428
22429 /* Update for Enabled SubSystem: '<S79>/Throttle_controller_gov' incorporates:
22430 * EnablePort: '<S212>/Enable'
22431 */
22432 if (L4_MABX_DW.Throttle_controller_gov_MODE) {
22433 /* Update for UnitDelay: '<S220>/Unit_Delay1' incorporates:
22434 * Constant: '<S220>/Constant3'
22435 */
22436 L4_MABX_DW.Unit_Delay1_DSTATE_p1 = L4_MABX_P.Constant3_Value_lp;
22437
22438 /* Update for UnitDelay: '<S220>/Unit_Delay' */
22439 L4_MABX_DW.Unit_Delay_DSTATE_lq = L4_MABX_B.RelationalOperator_fl;
22440
22441 /* Update for UnitDelay: '<S247>/Unit_Delay' incorporates:
22442 * Constant: '<S247>/Constant'
22443 */
22444 L4_MABX_DW.Unit_Delay_DSTATE_be = L4_MABX_P.Constant_Value_ck;
22445
22446 /* Update for UnitDelay: '<S267>/Unit_Delay1' incorporates:
22447 * Constant: '<S267>/Constant'
22448 */
22449 L4_MABX_DW.Unit_Delay1_DSTATE_h = L4_MABX_P.Constant_Value_ot;
22450
22451 /* Update for UnitDelay: '<S268>/Unit_Delay' incorporates:
22452 * Constant: '<S268>/Constant'
22453 */
22454 L4_MABX_DW.Unit_Delay_DSTATE_fi = L4_MABX_P.Constant_Value_h03;
22455
22456 /* Update for UnitDelay: '<S272>/FixPt Unit Delay2' incorporates:
22457 * Constant: '<S272>/FixPt Constant'
22458 */
22459 L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq = L4_MABX_P.FixPtConstant_Value_jk;
22460
22461 /* Update for UnitDelay: '<S272>/FixPt Unit Delay1' */
22462 L4_MABX_DW.FixPtUnitDelay1_DSTATE_a = L4_MABX_B.If_Then_Else_cp.Switch;
22463
22464 /* Update for UnitDelay: '<S267>/Unit_Delay2' */
22465 L4_MABX_DW.Unit_Delay2_DSTATE_m = L4_MABX_B.If_Then_Else_k.Switch;
22466
22467 /* Update for Enabled SubSystem: '<S244>/Calculate_D_term' */
22468 L4__Calculate_D_term_Update(&L4_MABX_B.Calculate_D_term_h,
22469 &L4_MABX_DW.Calculate_D_term_h, &L4_MABX_P.Calculate_D_term_h);
22470
22471 /* End of Update for SubSystem: '<S244>/Calculate_D_term' */
22472
22473 /* Update for UnitDelay: '<S222>/Unit_Delay' */
22474 L4_MABX_DW.Unit_Delay_DSTATE_fz = L4_MABX_B.Add_ds;
22475
22476 /* Update for Enabled SubSystem: '<S244>/Calculate_I_term' */
22477 L4__Calculate_I_term_Update(&L4_MABX_B.Calculate_I_term_n,
22478 &L4_MABX_DW.Calculate_I_term_n, &L4_MABX_P.Calculate_I_term_n);
22479
22480 /* End of Update for SubSystem: '<S244>/Calculate_I_term' */
22481 }
22482
22483 /* End of Update for SubSystem: '<S79>/Throttle_controller_gov' */
22484
22485 /* Update for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' incorporates:
22486 * EnablePort: '<S184>/Enable'
22487 */
22488 if (L4_MABX_DW.Determine_shift_interlock_brake) {
22489 /* Update for UnitDelay: '<S184>/Unit_Delay' */
22490 L4_MABX_DW.Unit_Delay_DSTATE_o = L4_MABX_B.If_Then_Else_il.Switch;
22491
22492 /* Update for UnitDelay: '<S194>/Unit_Delay' incorporates:
22493 * Constant: '<S194>/Constant'
22494 */
22495 L4_MABX_DW.Unit_Delay_DSTATE_ae = L4_MABX_P.Constant_Value_ii;
22496
22497 /* Update for UnitDelay: '<S198>/FixPt Unit Delay2' incorporates:
22498 * Constant: '<S198>/FixPt Constant'
22499 */
22500 L4_MABX_DW.FixPtUnitDelay2_DSTATE_l = L4_MABX_P.FixPtConstant_Value_k;
22501
22502 /* Update for UnitDelay: '<S198>/FixPt Unit Delay1' */
22503 L4_MABX_DW.FixPtUnitDelay1_DSTATE_d = L4_MABX_B.If_Then_Else_ep.Switch;
22504
22505 /* Update for UnitDelay: '<S195>/Unit_Delay' */
22506 L4_MABX_DW.Unit_Delay_DSTATE_om = L4_MABX_B.DigitalClock_e;
22507 }
22508
22509 /* End of Update for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */
22510
22511 /* Update for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' incorporates:
22512 * EnablePort: '<S183>/Enable'
22513 */
22514 if (L4_MABX_DW.Determine_brake_hold_pressure_t) {
22515 /* Update for UnitDelay: '<S183>/Unit_Delay' */
22516 L4_MABX_DW.Unit_Delay_DSTATE_c = L4_MABX_B.If_Then_Else_gj.Switch;
22517
22518 /* Update for UnitDelay: '<S187>/Unit_Delay' incorporates:
22519 * Constant: '<S187>/Constant'
22520 */
22521 L4_MABX_DW.Unit_Delay_DSTATE_or = L4_MABX_P.Constant_Value_m3;
22522
22523 /* Update for UnitDelay: '<S191>/FixPt Unit Delay2' incorporates:
22524 * Constant: '<S191>/FixPt Constant'
22525 */
22526 L4_MABX_DW.FixPtUnitDelay2_DSTATE_je = L4_MABX_P.FixPtConstant_Value_aw;
22527
22528 /* Update for UnitDelay: '<S191>/FixPt Unit Delay1' */
22529 L4_MABX_DW.FixPtUnitDelay1_DSTATE_b0 = L4_MABX_B.If_Then_Else_nz.Switch;
22530
22531 /* Update for UnitDelay: '<S188>/Unit_Delay' */
22532 L4_MABX_DW.Unit_Delay_DSTATE_oj = L4_MABX_B.DigitalClock_c;
22533 }
22534
22535 /* End of Update for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */
22536
22537 /* Update for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' incorporates:
22538 * EnablePort: '<S102>/Enable'
22539 */
22540 if (L4_MABX_DW.Bendix_2C2_brake_application_pr) {
22541 /* Update for UnitDelay: '<S111>/Unit_Delay' */
22542 L4_MABX_DW.Unit_Delay_DSTATE_d = L4_MABX_B.DigitalClock_j;
22543
22544 /* Update for UnitDelay: '<S115>/Unit_Delay' incorporates:
22545 * Constant: '<S115>/Constant'
22546 */
22547 L4_MABX_DW.Unit_Delay_DSTATE_omj = L4_MABX_P.Constant_Value_lo;
22548
22549 /* Update for UnitDelay: '<S135>/Unit_Delay1' incorporates:
22550 * Constant: '<S135>/Constant'
22551 */
22552 L4_MABX_DW.Unit_Delay1_DSTATE_b = L4_MABX_P.Constant_Value_olo;
22553
22554 /* Update for UnitDelay: '<S136>/Unit_Delay' incorporates:
22555 * Constant: '<S136>/Constant'
22556 */
22557 L4_MABX_DW.Unit_Delay_DSTATE_h4 = L4_MABX_P.Constant_Value_hi;
22558
22559 /* Update for UnitDelay: '<S140>/FixPt Unit Delay2' incorporates:
22560 * Constant: '<S140>/FixPt Constant'
22561 */
22562 L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm = L4_MABX_P.FixPtConstant_Value_fl;
22563
22564 /* Update for UnitDelay: '<S140>/FixPt Unit Delay1' */
22565 L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1 = L4_MABX_B.If_Then_Else_bg.Switch;
22566
22567 /* Update for UnitDelay: '<S135>/Unit_Delay2' */
22568 L4_MABX_DW.Unit_Delay2_DSTATE_dy = L4_MABX_B.If_Then_Else_ly.Switch;
22569
22570 /* Update for Enabled SubSystem: '<S112>/Calculate_D_term' */
22571 L4__Calculate_D_term_Update(&L4_MABX_B.Calculate_D_term,
22572 &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term);
22573
22574 /* End of Update for SubSystem: '<S112>/Calculate_D_term' */
22575
22576 /* Update for UnitDelay: '<S110>/Unit_Delay' */
22577 L4_MABX_DW.Unit_Delay_DSTATE_i = L4_MABX_B.Add_e;
22578
22579 /* Update for Enabled SubSystem: '<S112>/Calculate_I_term' */
22580 L4__Calculate_I_term_Update(&L4_MABX_B.Calculate_I_term,
22581 &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term);
22582
22583 /* End of Update for SubSystem: '<S112>/Calculate_I_term' */
22584 }
22585
22586 /* End of Update for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */
22587
22588 /* Update for UnitDelay: '<S389>/Unit_Delay' */
22589 L4_MABX_DW.Unit_Delay_DSTATE_cx = L4_MABX_B.LogicalOperator2_f5;
22590
22591 /* Update for UnitDelay: '<S390>/Unit_Delay' incorporates:
22592 * Constant: '<S390>/Constant'
22593 */
22594 L4_MABX_DW.Unit_Delay_DSTATE_d0 = L4_MABX_P.Constant_Value_c1;
22595
22596 /* Update for UnitDelay: '<S347>/Unit_Delay' */
22597 L4_MABX_DW.Unit_Delay_DSTATE_ef = L4_MABX_B.If_Then_Else_m4.Switch;
22598
22599 /* Update for UnitDelay: '<S394>/FixPt Unit Delay2' incorporates:
22600 * Constant: '<S394>/FixPt Constant'
22601 */
22602 L4_MABX_DW.FixPtUnitDelay2_DSTATE_a = L4_MABX_P.FixPtConstant_Value_jx;
22603
22604 /* Update for UnitDelay: '<S394>/FixPt Unit Delay1' */
22605 L4_MABX_DW.FixPtUnitDelay1_DSTATE_hj = L4_MABX_B.If_Then_Else_m4.Switch;
22606
22607 /* Update for UnitDelay: '<S391>/Unit_Delay' */
22608 L4_MABX_DW.Unit_Delay_DSTATE_m = L4_MABX_B.DigitalClock;
22609
22610 /* Update for UnitDelay: '<S378>/Unit_Delay' */
22611 L4_MABX_DW.Unit_Delay_DSTATE_iy = L4_MABX_B.LogicalOperator1_g;
22612
22613 /* Update for UnitDelay: '<S379>/Unit_Delay' incorporates:
22614 * Constant: '<S379>/Constant'
22615 */
22616 L4_MABX_DW.Unit_Delay_DSTATE_mv = L4_MABX_P.Constant_Value_am;
22617
22618 /* Update for UnitDelay: '<S345>/Unit_Delay' */
22619 L4_MABX_DW.Unit_Delay_DSTATE_g = L4_MABX_B.If_Then_Else_bf.Switch;
22620
22621 /* Update for UnitDelay: '<S383>/FixPt Unit Delay2' incorporates:
22622 * Constant: '<S383>/FixPt Constant'
22623 */
22624 L4_MABX_DW.FixPtUnitDelay2_DSTATE_ip = L4_MABX_P.FixPtConstant_Value_d;
22625
22626 /* Update for UnitDelay: '<S383>/FixPt Unit Delay1' */
22627 L4_MABX_DW.FixPtUnitDelay1_DSTATE_hq = L4_MABX_B.If_Then_Else_bf.Switch;
22628
22629 /* Update for UnitDelay: '<S380>/Unit_Delay' */
22630 L4_MABX_DW.Unit_Delay_DSTATE_b = L4_MABX_B.DigitalClock_b;
22631
22632 /* Update for UnitDelay: '<S342>/Delay Input1' */
22633 L4_MABX_DW.DelayInput1_DSTATE[0] = L4_MABX_B.Distance_to_achieve_speed_targe;
22634 L4_MABX_DW.DelayInput1_DSTATE[1] = L4_MABX_B.Vehicle_speed_target_o;
22635
22636 /* Update for UnitDelay: '<S360>/Unit_Delay' */
22637 L4_MABX_DW.Unit_Delay_DSTATE_bw = L4_MABX_B.If_Then_Else_og.Switch;
22638
22639 /* Update for UnitDelay: '<S362>/Unit_Delay' */
22640 L4_MABX_DW.Unit_Delay_DSTATE_ko = L4_MABX_B.LogicalOperator1_p;
22641
22642 /* Update for UnitDelay: '<S371>/FixPt Unit Delay2' incorporates:
22643 * Constant: '<S371>/FixPt Constant'
22644 */
22645 L4_MABX_DW.FixPtUnitDelay2_DSTATE_fh = L4_MABX_P.FixPtConstant_Value_gy;
22646
22647 /* Update for UnitDelay: '<S371>/FixPt Unit Delay1' */
22648 L4_MABX_DW.FixPtUnitDelay1_DSTATE_l = L4_MABX_B.Xnew;
22649
22650 /* Update for UnitDelay: '<S369>/Unit_Delay' */
22651 L4_MABX_DW.Unit_Delay_DSTATE_p = L4_MABX_B.DigitalClock_f;
22652
22653 /* Update for UnitDelay: '<S349>/Delay Input1' */
22654 L4_MABX_DW.DelayInput1_DSTATE_f[0] = L4_MABX_B.Distance_to_achieve_speed_targe;
22655 L4_MABX_DW.DelayInput1_DSTATE_f[1] = L4_MABX_B.Vehicle_speed_target_o;
22656
22657 /* Update for UnitDelay: '<S351>/Unit_Delay' incorporates:
22658 * Constant: '<S351>/Constant'
22659 */
22660 L4_MABX_DW.Unit_Delay_DSTATE_la = L4_MABX_P.Constant_Value_pu;
22661
22662 /* Update for UnitDelay: '<S355>/FixPt Unit Delay2' incorporates:
22663 * Constant: '<S355>/FixPt Constant'
22664 */
22665 L4_MABX_DW.FixPtUnitDelay2_DSTATE_c = L4_MABX_P.FixPtConstant_Value_az;
22666
22667 /* Update for UnitDelay: '<S355>/FixPt Unit Delay1' */
22668 L4_MABX_DW.FixPtUnitDelay1_DSTATE_ej = L4_MABX_B.If_Then_Else_pz.Switch;
22669
22670 /* Update for UnitDelay: '<S350>/Unit_Delay' */
22671 L4_MABX_DW.Unit_Delay_1_DSTATE_j =
22672 L4_MABX_B.If_Then_Else_mm.Vehicle_speed_target;
22673 L4_MABX_DW.Unit_Delay_2_DSTATE_e = L4_MABX_B.If_Then_Else_mm.Vehicle_speed;
22674 L4_MABX_DW.Unit_Delay_3_DSTATE_j = L4_MABX_B.If_Then_Else_mm.Distance_m;
22675
22676 /* Update for UnitDelay: '<S348>/Unit_Delay' */
22677 L4_MABX_DW.Unit_Delay_DSTATE_f = L4_MABX_B.DigitalClock_p;
22678
22679 /* Update for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' incorporates:
22680 * EnablePort: '<S103>/Enable'
22681 */
22682 if (L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba) {
22683 /* Update for UnitDelay: '<S146>/Unit_Delay' */
22684 L4_MABX_DW.Unit_Delay_DSTATE_eu = L4_MABX_B.DigitalClock_n;
22685
22686 /* Update for UnitDelay: '<S153>/Unit_Delay' incorporates:
22687 * Constant: '<S153>/Constant'
22688 */
22689 L4_MABX_DW.Unit_Delay_DSTATE_n = L4_MABX_P.Constant_Value_j5;
22690
22691 /* Update for UnitDelay: '<S173>/Unit_Delay1' incorporates:
22692 * Constant: '<S173>/Constant'
22693 */
22694 L4_MABX_DW.Unit_Delay1_DSTATE_f = L4_MABX_P.Constant_Value_bd;
22695
22696 /* Update for UnitDelay: '<S174>/Unit_Delay' incorporates:
22697 * Constant: '<S174>/Constant'
22698 */
22699 L4_MABX_DW.Unit_Delay_DSTATE_g4 = L4_MABX_P.Constant_Value_m2;
22700
22701 /* Update for UnitDelay: '<S178>/FixPt Unit Delay2' incorporates:
22702 * Constant: '<S178>/FixPt Constant'
22703 */
22704 L4_MABX_DW.FixPtUnitDelay2_DSTATE_o4 = L4_MABX_P.FixPtConstant_Value_j;
22705
22706 /* Update for UnitDelay: '<S178>/FixPt Unit Delay1' */
22707 L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2 = L4_MABX_B.If_Then_Else_iy.Switch;
22708
22709 /* Update for UnitDelay: '<S173>/Unit_Delay2' */
22710 L4_MABX_DW.Unit_Delay2_DSTATE_c = L4_MABX_B.If_Then_Else_bc.Switch;
22711
22712 /* Update for Enabled SubSystem: '<S150>/Calculate_D_term' */
22713 L4__Calculate_D_term_Update(&L4_MABX_B.Calculate_D_term_p,
22714 &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p);
22715
22716 /* End of Update for SubSystem: '<S150>/Calculate_D_term' */
22717
22718 /* Update for UnitDelay: '<S145>/Unit_Delay' */
22719 L4_MABX_DW.Unit_Delay_DSTATE_h = L4_MABX_B.Add_mh;
22720
22721 /* Update for Enabled SubSystem: '<S150>/Calculate_I_term' */
22722 L4__Calculate_I_term_Update(&L4_MABX_B.Calculate_I_term_e,
22723 &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e);
22724
22725 /* End of Update for SubSystem: '<S150>/Calculate_I_term' */
22726 }
22727
22728 /* End of Update for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */
22729
22730 /* Update for UnitDelay: '<S107>/Unit_Delay' incorporates:
22731 * Constant: '<S107>/Constant7'
22732 */
22733 L4_MABX_DW.Unit_Delay_DSTATE_eu4 = L4_MABX_P.Constant7_Value_j;
22734
22735 /* Update for UnitDelay: '<S203>/Unit_Delay1' incorporates:
22736 * Constant: '<S203>/Constant'
22737 */
22738 L4_MABX_DW.Unit_Delay1_DSTATE_d = L4_MABX_P.Constant_Value_jf;
22739
22740 /* Update for UnitDelay: '<S203>/Unit_Delay2' */
22741 L4_MABX_DW.Unit_Delay2_DSTATE_e = L4_MABX_B.If_Then_Else_ga.Switch;
22742
22743 /* Update for UnitDelay: '<S202>/UD' */
22744 L4_MABX_DW.UD_DSTATE = L4_MABX_B.TSamp;
22745
22746 /* Update for UnitDelay: '<S327>/Unit_Delay1' incorporates:
22747 * Constant: '<S327>/Constant'
22748 */
22749 L4_MABX_DW.Unit_Delay1_DSTATE_db = L4_MABX_P.Constant_Value_hx;
22750
22751 /* Update for UnitDelay: '<S327>/Unit_Delay2' */
22752 L4_MABX_DW.Unit_Delay2_DSTATE_d = L4_MABX_B.If_Then_Else_b3.Switch;
22753
22754 /* Update for UnitDelay: '<S326>/Delay Input1' */
22755 L4_MABX_DW.DelayInput1_DSTATE_f0 = L4_MABX_B.JumpNearEdge;
22756
22757 /* Update for UnitDelay: '<S328>/Unit_Delay1' incorporates:
22758 * Constant: '<S328>/Constant'
22759 */
22760 L4_MABX_DW.Unit_Delay1_DSTATE_a = L4_MABX_P.Constant_Value_bh;
22761
22762 /* Update for UnitDelay: '<S328>/Unit_Delay2' */
22763 L4_MABX_DW.Unit_Delay2_DSTATE_i = L4_MABX_B.If_Then_Else_mk.Switch;
22764
22765 /* Update for UnitDelay: '<S329>/Unit_Delay1' incorporates:
22766 * Constant: '<S329>/Constant'
22767 */
22768 L4_MABX_DW.Unit_Delay1_DSTATE_p3 = L4_MABX_P.Constant_Value_hxo;
22769
22770 /* Update for UnitDelay: '<S329>/Unit_Delay2' */
22771 L4_MABX_DW.Unit_Delay2_DSTATE_p = L4_MABX_B.If_Then_Else_lh.Switch;
22772
22773 /* Update for Enabled SubSystem: '<S283>/Slew_at_event' incorporates:
22774 * EnablePort: '<S334>/Enable'
22775 */
22776 if (L4_MABX_DW.Slew_at_event_MODE_d) {
22777 /* Update for UnitDelay: '<S336>/Unit_Delay' */
22778 L4_MABX_DW.Unit_Delay_DSTATE_bd = L4_MABX_B.DataTypeConversion_l1;
22779
22780 /* Update for UnitDelay: '<S337>/Unit_Delay' incorporates:
22781 * Constant: '<S337>/Constant'
22782 */
22783 L4_MABX_DW.Unit_Delay_DSTATE_jt = L4_MABX_P.Constant_Value_hg;
22784
22785 /* Update for UnitDelay: '<S340>/FixPt Unit Delay2' incorporates:
22786 * Constant: '<S340>/FixPt Constant'
22787 */
22788 L4_MABX_DW.FixPtUnitDelay2_DSTATE_j = L4_MABX_P.FixPtConstant_Value_n;
22789
22790 /* Update for UnitDelay: '<S340>/FixPt Unit Delay1' */
22791 L4_MABX_DW.FixPtUnitDelay1_DSTATE_ov = L4_MABX_B.If_Then_Else_n3.Switch;
22792
22793 /* Update for UnitDelay: '<S335>/Unit_Delay' */
22794 L4_MABX_DW.Unit_Delay_DSTATE_ll = L4_MABX_B.LogicalOperator_dm;
22795 }
22796
22797 /* End of Update for SubSystem: '<S283>/Slew_at_event' */
22798
22799 /* Update for UnitDelay: '<S285>/Unit Delay' */
22800 L4_MABX_DW.UnitDelay_DSTATE_d = L4_MABX_B.Switch1_fi;
22801
22802 /* Update for UnitDelay: '<S295>/Unit Delay' */
22803 L4_MABX_DW.UnitDelay_DSTATE_ml = L4_MABX_B.Add1_m;
22804
22805 /* Update for UnitDelay: '<S296>/Unit Delay' */
22806 L4_MABX_DW.UnitDelay_DSTATE_m0 = L4_MABX_B.Switch_ko;
22807
22808 /* Update for UnitDelay: '<S296>/Unit Delay1' */
22809 L4_MABX_DW.UnitDelay1_DSTATE_k = L4_MABX_B.Divide1_b;
22810
22811 /* Update for UnitDelay: '<S290>/Unit Delay' */
22812 L4_MABX_DW.UnitDelay_DSTATE_m1 = L4_MABX_B.Switch1_pb;
22813
22814 /* Update for UnitDelay: '<S308>/Delay Input2' */
22815 L4_MABX_DW.DelayInput2_DSTATE = L4_MABX_B.DifferenceInputs2;
22816
22817 /* Update for DiscreteIntegrator: '<S307>/Integrator' */
22818 L4_MABX_DW.Integrator_DSTATE += L4_MABX_P.Integrator_gainval *
22819 L4_MABX_B.IntegralGain;
22820 L4_MABX_DW.Integrator_PrevResetState = (int8_T)L4_MABX_B.AutonomousEnabled_d;
22821
22822 /* Update for DiscreteIntegrator: '<S307>/Filter' */
22823 L4_MABX_DW.Filter_DSTATE += L4_MABX_P.Filter_gainval *
22824 L4_MABX_B.FilterCoefficient;
22825 L4_MABX_DW.Filter_PrevResetState = (int8_T)L4_MABX_B.AutonomousEnabled_d;
22826
22827 /* Update for UnitDelay: '<S311>/Delay Input' */
22828 L4_MABX_DW.DelayInput_DSTATE = L4_MABX_B.Saturate;
22829
22830 /* Update for UnitDelay: '<S311>/Delay Output' */
22831 L4_MABX_DW.DelayOutput_DSTATE = L4_MABX_B.Downcast;
22832
22833 /* Update for UnitDelay: '<S309>/Delay Input2' */
22834 L4_MABX_DW.DelayInput2_DSTATE_a = L4_MABX_B.DifferenceInputs2_a;
22835
22836 /* Update for DiscreteIntegrator: '<S301>/Discrete-Time Integrator' */
22837 L4_MABX_DW.DiscreteTimeIntegrator_IC_LOADI = 0U;
22838 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE +=
22839 L4_MABX_P.DiscreteTimeIntegrator_gainval * L4_MABX_B.Gain_o;
22840 L4_MABX_DW.DiscreteTimeIntegrator_PrevRese = (int8_T)
22841 L4_MABX_B.AutonomousEnabled_d;
22842
22843 /* Update for UnitDelay: '<S321>/Delay Input2' */
22844 L4_MABX_DW.DelayInput2_DSTATE_l = L4_MABX_B.DifferenceInputs2_m;
22845
22846 /* Update for DiscreteIntegrator: '<S80>/Discrete-Time Integrator' incorporates:
22847 * Constant: '<S80>/ResetIntegrator'
22848 */
22849 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e +=
22850 L4_MABX_P.DiscreteTimeIntegrator_gainva_l * L4_MABX_B.Switch1_p;
22851 if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e >=
22852 L4_MABX_P.DiscreteTimeIntegrator_UpperSat) {
22853 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e =
22854 L4_MABX_P.DiscreteTimeIntegrator_UpperSat;
22855 } else {
22856 if (L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e <=
22857 L4_MABX_P.DiscreteTimeIntegrator_LowerSat) {
22858 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e =
22859 L4_MABX_P.DiscreteTimeIntegrator_LowerSat;
22860 }
22861 }
22862
22863 if (L4_MABX_P.ResetIntegrator_Value > 0.0) {
22864 L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 1;
22865 } else if (L4_MABX_P.ResetIntegrator_Value < 0.0) {
22866 L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = -1;
22867 } else if (L4_MABX_P.ResetIntegrator_Value == 0.0) {
22868 L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 0;
22869 } else {
22870 L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 2;
22871 }
22872
22873 /* End of Update for DiscreteIntegrator: '<S80>/Discrete-Time Integrator' */
22874
22875 /* Update for UnitDelay: '<S80>/Unit Delay' */
22876 L4_MABX_DW.UnitDelay_DSTATE_e3 = L4_MABX_B.Switch2_i1;
22877
22878 /* Update for UnitDelay: '<S373>/FixPt Unit Delay2' incorporates:
22879 * Constant: '<S373>/FixPt Constant'
22880 */
22881 L4_MABX_DW.FixPtUnitDelay2_DSTATE_aw = L4_MABX_P.FixPtConstant_Value_p2;
22882
22883 /* Update for UnitDelay: '<S373>/FixPt Unit Delay1' */
22884 L4_MABX_DW.FixPtUnitDelay1_DSTATE_pe = L4_MABX_B.Xnew_h;
22885
22886 /* Update for UnitDelay: '<S374>/FixPt Unit Delay2' incorporates:
22887 * Constant: '<S374>/FixPt Constant'
22888 */
22889 L4_MABX_DW.FixPtUnitDelay2_DSTATE_g = L4_MABX_P.FixPtConstant_Value_e;
22890
22891 /* Update for UnitDelay: '<S374>/FixPt Unit Delay1' */
22892 L4_MABX_DW.FixPtUnitDelay1_DSTATE_g = L4_MABX_B.Xnew_f;
22893
22894 /* Update for UnitDelay: '<S368>/Unit_Delay' */
22895 L4_MABX_DW.Unit_Delay_DSTATE_j = L4_MABX_B.DigitalClock_d;
22896
22897 /* End of Update for SubSystem: '<S65>/Task_10ms' */
22898
22899 /* Update for Atomic SubSystem: '<S849>/CAN_TX_10ms' */
22900
22901 /* Update for UnitDelay: '<S1006>/Unit_Delay' */
22902 L4_MABX_DW.Unit_Delay_DSTATE_im = L4_MABX_B.Operator_n3;
22903
22904 /* Update for UnitDelay: '<S1007>/Unit Delay' */
22905 L4_MABX_DW.UnitDelay_DSTATE_mk = L4_MABX_B.Switch1_ab;
22906
22907 /* End of Update for SubSystem: '<S849>/CAN_TX_10ms' */
22908
22909 /* Update for UnitDelay: '<S859>/Unit Delay2' */
22910 L4_MABX_DW.UnitDelay2_DSTATE = L4_MABX_B.enTPCM;
22911
22912 /* Update for UnitDelay: '<S859>/Unit Delay1' */
22913 L4_MABX_DW.UnitDelay1_DSTATE_d = L4_MABX_B.TPDT_count;
22914
22915 /* Update for UnitDelay: '<S859>/Unit Delay3' */
22916 L4_MABX_DW.UnitDelay3_DSTATE = L4_MABX_B.enTPDT;
22917
22918 /* Update for UnitDelay: '<S3>/Unit_Delay' incorporates:
22919 * Constant: '<S208>/Constant'
22920 * Constant: '<S80>/zero'
22921 */
22922 L4_MABX_DW.Unit_Delay_1_DSTATE = L4_MABX_B.Subtract_c1;
22923 L4_MABX_DW.Unit_Delay_10_DSTATE = L4_MABX_B.Add1_h;
22924 L4_MABX_DW.Unit_Delay_100_DSTATE = L4_MABX_B.SFunction1_o3_ob;
22925 L4_MABX_DW.Unit_Delay_101_DSTATE = L4_MABX_B.SPN514_NominalFrictionPercentTo;
22926 L4_MABX_DW.Unit_Delay_102_DSTATE = L4_MABX_B.SPN2978_EstEngParasiticLossesPe;
22927 L4_MABX_DW.Unit_Delay_103_DSTATE = L4_MABX_B.SPN1760_GrossCombinationVehicle;
22928 L4_MABX_DW.Unit_Delay_104_DSTATE = L4_MABX_B.ACCDistanceAlertSignal;
22929 L4_MABX_DW.Unit_Delay_105_DSTATE = L4_MABX_B.ForwardCollisionWarning;
22930 L4_MABX_DW.Unit_Delay_106_DSTATE = L4_MABX_B.SPN544_EngineReferenceTorque;
22931 L4_MABX_DW.Unit_Delay_107_DSTATE = L4_MABX_B.SFunction1_o4_o;
22932 L4_MABX_DW.Unit_Delay_108_DSTATE = L4_MABX_B.SFunction1_o5_m;
22933 L4_MABX_DW.Unit_Delay_109_DSTATE = L4_MABX_B.SFunction1_o6_n;
22934 L4_MABX_DW.Unit_Delay_11_DSTATE = L4_MABX_B.Switch2_i1;
22935 L4_MABX_DW.Unit_Delay_110_DSTATE = L4_MABX_B.SFunction1_o7_f;
22936 L4_MABX_DW.Unit_Delay_111_DSTATE = SteerWheelAngle;
22937 L4_MABX_DW.Unit_Delay_112_DSTATE = YawRate;
22938 L4_MABX_DW.Unit_Delay_113_DSTATE = SPN1810_LongitudinalAcceleration;
22939 L4_MABX_DW.Unit_Delay_114_DSTATE = L4_MABX_B.SFunction1_o2_i;
22940 L4_MABX_DW.Unit_Delay_115_DSTATE = L4_MABX_B.SFunction1_o3_a0;
22941 L4_MABX_DW.Unit_Delay_116_DSTATE = L4_MABX_B.SFunction1_o5_f;
22942 L4_MABX_DW.Unit_Delay_117_DSTATE = L4_MABX_B.SFunction1_o1_nb;
22943 L4_MABX_DW.Unit_Delay_118_DSTATE = L4_MABX_B.SFunction1_o3_ip;
22944 L4_MABX_DW.Unit_Delay_119_DSTATE = L4_MABX_B.LogicalOperator1_c;
22945 L4_MABX_DW.Unit_Delay_12_DSTATE = L4_MABX_B.DiscreteTimeIntegrator_h;
22946 L4_MABX_DW.Unit_Delay_120_DSTATE = L4_MABX_B.LogicalOperator1_e;
22947 L4_MABX_DW.Unit_Delay_121_DSTATE = L4_MABX_B.PitchAngleExRange;
22948 L4_MABX_DW.Unit_Delay_122_DSTATE = L4_MABX_B.SFunction1_o3_on;
22949 L4_MABX_DW.Unit_Delay_123_DSTATE = L4_MABX_B.SFunction1_o1_m;
22950 L4_MABX_DW.Unit_Delay_124_DSTATE = L4_MABX_B.SFunction1_o2_kz;
22951 L4_MABX_DW.Unit_Delay_125_DSTATE = L4_MABX_B.Latitude_;
22952 L4_MABX_DW.Unit_Delay_126_DSTATE = L4_MABX_B.Longitude_;
22953 L4_MABX_DW.Unit_Delay_127_DSTATE = L4_MABX_B.HDOP_;
22954 L4_MABX_DW.Unit_Delay_128_DSTATE = L4_MABX_B.XPRControlMode;
22955 L4_MABX_DW.Unit_Delay_129_DSTATE = L4_MABX_B.XPRErrorState;
22956 L4_MABX_DW.Unit_Delay_13_DSTATE = L4_MABX_B.numLanePoints_j;
22957 L4_MABX_DW.Unit_Delay_130_DSTATE = L4_MABX_B.PressureP1;
22958 L4_MABX_DW.Unit_Delay_131_DSTATE = L4_MABX_B.PressureP4;
22959 L4_MABX_DW.Unit_Delay_132_DSTATE = L4_MABX_B.PressureP21;
22960 L4_MABX_DW.Unit_Delay_133_DSTATE = L4_MABX_B.PressureP22;
22961 L4_MABX_DW.Unit_Delay_134_DSTATE = L4_MABX_B.PressureP42;
22962 L4_MABX_DW.Unit_Delay_135_DSTATE = ReAX_ActualHandwheelPos;
22963 L4_MABX_DW.Unit_Delay_136_DSTATE = ReAX_EchoedSteerWheelPos;
22964 L4_MABX_DW.Unit_Delay_137_DSTATE = L4_MABX_B.SystemsOk;
22965 L4_MABX_DW.Unit_Delay_138_DSTATE = SupervisorMode;
22966 L4_MABX_DW.Unit_Delay_139_DSTATE = CurrentAzimuth_rad;
22967 L4_MABX_DW.Unit_Delay_14_DSTATE = L4_MABX_B.correctedError;
22968 L4_MABX_DW.Unit_Delay_140_DSTATE = TargetAzimuth_rad;
22969 L4_MABX_DW.Unit_Delay_141_DSTATE = CurrentVelocity_kph;
22970 L4_MABX_DW.Unit_Delay_142_DSTATE = TargetVelocity_kph;
22971 L4_MABX_DW.Unit_Delay_143_DSTATE = Curvature;
22972 L4_MABX_DW.Unit_Delay_144_DSTATE = CrosstrackError;
22973 L4_MABX_DW.Unit_Delay_15_DSTATE = L4_MABX_B.Switch1_j;
22974 L4_MABX_DW.Unit_Delay_16_DSTATE = L4_MABX_B.rad2deg1;
22975 L4_MABX_DW.Unit_Delay_17_DSTATE = L4_MABX_B.If_Then_Else_iz.Switch;
22976 L4_MABX_DW.Unit_Delay_18_DSTATE = L4_MABX_B.APTC_arb_pedal_low_idl_sw_o;
22977 L4_MABX_DW.Unit_Delay_19_DSTATE = L4_MABX_B.If_Then_Else_f.Switch;
22978 L4_MABX_DW.Unit_Delay_2_DSTATE = L4_MABX_B.Add3;
22979 L4_MABX_DW.Unit_Delay_20_DSTATE = L4_MABX_P.Constant_Value_jg4;
22980 L4_MABX_DW.Unit_Delay_21_DSTATE = L4_MABX_B.If_Then_Else_pi.Switch;
22981 L4_MABX_DW.Unit_Delay_22_DSTATE = L4_MABX_B.Add_ds;
22982 L4_MABX_DW.Unit_Delay_23_DSTATE = L4_MABX_B.If_Then_Else_k.Switch;
22983 L4_MABX_DW.Unit_Delay_24_DSTATE = L4_MABX_B.Product_i;
22984 L4_MABX_DW.Unit_Delay_25_DSTATE = L4_MABX_B.PID_i_term_c;
22985 L4_MABX_DW.Unit_Delay_26_DSTATE = L4_MABX_B.PID_d_term_c;
22986 L4_MABX_DW.Unit_Delay_27_DSTATE = L4_MABX_B.PID_hold_i_term_f_b;
22987 L4_MABX_DW.Unit_Delay_28_DSTATE = L4_MABX_B.ThrottlePID_Y_m;
22988 L4_MABX_DW.Unit_Delay_29_DSTATE = L4_MABX_B.MinMax1_n;
22989 L4_MABX_DW.Unit_Delay_3_DSTATE = L4_MABX_B.Add_px;
22990 L4_MABX_DW.Unit_Delay_30_DSTATE = L4_MABX_B.F_Ignition_relay_command_i;
22991 L4_MABX_DW.Unit_Delay_31_DSTATE = L4_MABX_B.F_Inverter_relay_command_p;
22992 L4_MABX_DW.Unit_Delay_32_DSTATE = L4_MABX_B.F_MABX_relay_command_n;
22993 L4_MABX_DW.Unit_Delay_33_DSTATE = L4_MABX_B.F_Sensor_relay_command_k;
22994 L4_MABX_DW.Unit_Delay_34_DSTATE = L4_MABX_B.BrkPedArbBrakeSwitch_c;
22995 L4_MABX_DW.Unit_Delay_35_DSTATE = L4_MABX_B.Diff;
22996 L4_MABX_DW.Unit_Delay_36_DSTATE = L4_MABX_B.F_Brake_control_active;
22997 L4_MABX_DW.Unit_Delay_37_DSTATE = L4_MABX_B.F_Hold_brakes_at_zero_d;
22998 L4_MABX_DW.Unit_Delay_38_DSTATE = L4_MABX_B.BrakingPID_Y_k5;
22999 L4_MABX_DW.Unit_Delay_39_DSTATE = 0.0;
23000 L4_MABX_DW.Unit_Delay_4_DSTATE = L4_MABX_B.Product_d;
23001 L4_MABX_DW.Unit_Delay_40_DSTATE = L4_MABX_B.VSPD_TARGET_KPH_APV_g;
23002 L4_MABX_DW.Unit_Delay_41_DSTATE = L4_MABX_B.Vehicle_speed_target_n;
23003 L4_MABX_DW.Unit_Delay_42_DSTATE = L4_MABX_B.VSPD_HYST_KPH_APV_f;
23004 L4_MABX_DW.Unit_Delay_43_DSTATE = L4_MABX_B.VSPD_BRAKE_STOP_THRESH_KPH_AP_b;
23005 L4_MABX_DW.Unit_Delay_44_DSTATE = L4_MABX_B.ACCEL_LIM_MS2_APV_b;
23006 L4_MABX_DW.Unit_Delay_46_DSTATE = AutonomousOutputEnabled;
23007 L4_MABX_DW.Unit_Delay_5_DSTATE = L4_MABX_B.Switch2_i;
23008 L4_MABX_DW.Unit_Delay_6_DSTATE = L4_MABX_B.Conversion;
23009 L4_MABX_DW.Unit_Delay_7_DSTATE = L4_MABX_B.Add2;
23010 L4_MABX_DW.Unit_Delay_8_DSTATE = L4_MABX_P.zero_Value;
23011 L4_MABX_DW.Unit_Delay_82_DSTATE = EngagePB;
23012 L4_MABX_DW.Unit_Delay_85_DSTATE = Pedal_pwm_position;
23013 L4_MABX_DW.Unit_Delay_86_DSTATE = L4_MABX_B.IgnitionKeySwitch_voltage;
23014 L4_MABX_DW.Unit_Delay_87_DSTATE = L4_MABX_B.SFunction1_o8_ct;
23015 L4_MABX_DW.Unit_Delay_88_DSTATE = L4_MABX_B.SFunction1_o2_gh;
23016 L4_MABX_DW.Unit_Delay_89_DSTATE = L4_MABX_B.SFunction1_o7_au;
23017 L4_MABX_DW.Unit_Delay_9_DSTATE = L4_MABX_B.Add1_h;
23018 L4_MABX_DW.Unit_Delay_90_DSTATE = L4_MABX_B.SFunction1_o1_ie;
23019 L4_MABX_DW.Unit_Delay_91_DSTATE = L4_MABX_B.SFunction1_o1_i4;
23020 L4_MABX_DW.Unit_Delay_92_DSTATE = L4_MABX_B.SFunction1_o2_da;
23021 L4_MABX_DW.Unit_Delay_93_DSTATE = L4_MABX_B.SFunction1_o4_oc;
23022 L4_MABX_DW.Unit_Delay_94_DSTATE = L4_MABX_B.SPN524_TransSelectedGear;
23023 L4_MABX_DW.Unit_Delay_95_DSTATE = L4_MABX_B.SPN523_TransCurrentGear;
23024 L4_MABX_DW.Unit_Delay_96_DSTATE = L4_MABX_B.SPN526_TransActualGearRatio;
23025 L4_MABX_DW.Unit_Delay_97_DSTATE = L4_MABX_B.SFunction1_o4_jr;
23026 L4_MABX_DW.Unit_Delay_98_DSTATE = L4_MABX_B.SFunction1_o2_a4;
23027 L4_MABX_DW.Unit_Delay_99_DSTATE = L4_MABX_B.SFunction1_o5_en;
23028
23029 /* Update for UnitDelay: '<S649>/Unit_Delay2' */
23030 L4_MABX_DW.Unit_Delay2_DSTATE_k = L4_MABX_B.LogicalOperator2_h;
23031
23032 /* Update for UnitDelay: '<S649>/Unit_Delay1' incorporates:
23033 * Constant: '<S649>/Constant1'
23034 */
23035 L4_MABX_DW.Unit_Delay1_DSTATE_p = L4_MABX_P.Constant1_Value_fh;
23036
23037 /* Update for UnitDelay: '<S656>/Unit_Delay' */
23038 L4_MABX_DW.Unit_Delay_DSTATE_g1 = L4_MABX_B.LogicalOperator1_e;
23039
23040 /* Update for UnitDelay: '<S747>/Delay Input1' */
23041 L4_MABX_DW.DelayInput1_DSTATE_o = L4_MABX_B.Compare_ng;
23042
23043 /* Update for UnitDelay: '<S748>/Unit Delay' */
23044 L4_MABX_DW.UnitDelay_DSTATE_e = L4_MABX_B.Switch_f;
23045
23046 /* Update for UnitDelay: '<S742>/Unit Delay' */
23047 L4_MABX_DW.UnitDelay_DSTATE_dy = L4_MABX_B.AND_e;
23048
23049 /* Update for UnitDelay: '<S746>/Delay Input1' */
23050 L4_MABX_DW.DelayInput1_DSTATE_h = L4_MABX_B.Compare_bv;
23051
23052 /* Update for UnitDelay: '<S748>/Unit Delay1' */
23053 L4_MABX_DW.UnitDelay1_DSTATE_c = L4_MABX_B.AND_d;
23054
23055 /* Update for UnitDelay: '<S749>/Unit Delay' */
23056 L4_MABX_DW.UnitDelay_DSTATE_j = L4_MABX_B.Switch_b;
23057
23058 /* Update for UnitDelay: '<S749>/Unit Delay1' */
23059 L4_MABX_DW.UnitDelay1_DSTATE_c2 = L4_MABX_B.AND_e;
23060
23061 /* Update for UnitDelay: '<S10>/Unit_Delay' incorporates:
23062 * Constant: '<S10>/Constant'
23063 */
23064 L4_MABX_DW.Unit_Delay_DSTATE_do = L4_MABX_P.Constant_Value_g5;
23065
23066 /* Update absolute time */
23067 /* The "clockTick0" counts the number of times the code of this task has
23068 * been executed. The absolute time is the multiplication of "clockTick0"
23069 * and "Timing.stepSize0". Size of "clockTick0" ensures timer will not
23070 * overflow during the application lifespan selected.
23071 * Timer of this task consists of two 32 bit unsigned integers.
23072 * The two integers represent the low bits Timing.clockTick0 and the high bits
23073 * Timing.clockTickH0. When the low bit overflows to 0, the high bits increment.
23074 */
23075 if (!(++L4_MABX_M->Timing.clockTick0)) {
23076 ++L4_MABX_M->Timing.clockTickH0;
23077 }
23078
23079 L4_MABX_M->Timing.t[0] = L4_MABX_M->Timing.clockTick0 *
23080 L4_MABX_M->Timing.stepSize0 + L4_MABX_M->Timing.clockTickH0 *
23081 L4_MABX_M->Timing.stepSize0 * 4294967296.0;
23082}
23083
23084/* Model output function for TID1 */
23085void L4_MABX_output1(void) /* Sample time: [0.02s, 0.0s] */
23086{
23087 int_T tid = 1;
23088 int32_T i;
23089 uint32_T q0;
23090 uint32_T qY;
23091 uint8_T tmp;
23092 real_T u0;
23093 real_T u1;
23094 real_T u2;
23095
23096 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_20ms' */
23097
23098 /* Switch: '<S1015>/Switch1' incorporates:
23099 * Constant: '<S1015>/Constant4'
23100 */
23101 if (L4_MABX_B.AutonomousOutputEnabled_i) {
23102 /* Product: '<S1015>/Divide1' incorporates:
23103 * Constant: '<S1015>/Constant2'
23104 */
23105 L4_MABX_B.XBRExternalAccelDemand_i = L4_MABX_B.BrakingPID_Y_k *
23106 L4_MABX_P.Constant2_Value_hz;
23107 L4_MABX_B.XBRExternalAccelDemand = L4_MABX_B.XBRExternalAccelDemand_i;
23108 } else {
23109 L4_MABX_B.XBRExternalAccelDemand = L4_MABX_P.Constant4_Value_k;
23110 }
23111
23112 /* End of Switch: '<S1015>/Switch1' */
23113
23114 /* MultiPortSwitch: '<S1015>/Multiport Switch' incorporates:
23115 * Constant: '<S1015>/Constant10'
23116 * Constant: '<S1015>/Constant7'
23117 * Constant: '<S1015>/Constant8'
23118 * Constant: '<S1015>/Constant9'
23119 */
23120 switch ((int32_T)L4_MABX_B.BrakingControlActive_h) {
23121 case 0:
23122 L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant10_Value_i;
23123 break;
23124
23125 case 1:
23126 L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant7_Value_d;
23127 break;
23128
23129 case 2:
23130 L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant8_Value_d;
23131 break;
23132
23133 default:
23134 L4_MABX_B.XBRPassThroughActive = L4_MABX_P.Constant9_Value_j;
23135 break;
23136 }
23137
23138 /* End of MultiPortSwitch: '<S1015>/Multiport Switch' */
23139
23140 /* Outputs for Atomic SubSystem: '<S1015>/If_Then_Else' */
23141
23142 /* Constant: '<S1015>/XBRValueOverride' incorporates:
23143 * Constant: '<S1015>/XBRControlMode'
23144 * Constant: '<S1015>/XBRControlModeOVR'
23145 * Constant: '<S1015>/XBREnduranceBrakeIntegrationMode'
23146 * Constant: '<S1015>/XBREnduranceBrakeIntegrationModeOVR'
23147 * Constant: '<S1015>/XBRExternalAccelDemandOVR'
23148 * Constant: '<S1015>/XBRPassThroughActiveOVR'
23149 * Constant: '<S1015>/XBRPassThroughEnabled'
23150 * Constant: '<S1015>/XBRPassThroughEnabledOVR'
23151 * Constant: '<S1015>/XBRPriority'
23152 * Constant: '<S1015>/XBRPriorityOVR'
23153 * Constant: '<S1015>/XBRUrgency'
23154 * Constant: '<S1015>/XBRUrgencyOVR'
23155 */
23156 L4_MABX_If_Then_Else_d(L4_MABX_P.XBRValueOverride_Value,
23157 L4_MABX_P.XBRExternalAccelDemandOVR_Value,
23158 L4_MABX_P.XBREnduranceBrakeIntegrationMod, L4_MABX_P.XBRPriorityOVR_Value,
23159 L4_MABX_P.XBRControlModeOVR_Value, L4_MABX_P.XBRPassThroughActiveOVR_Value,
23160 L4_MABX_P.XBRUrgencyOVR_Value, L4_MABX_P.XBRPassThroughEnabledOVR_Value,
23161 L4_MABX_B.XBRExternalAccelDemand, L4_MABX_P.XBREnduranceBrakeIntegrationM_g,
23162 L4_MABX_P.XBRPriority_Value, L4_MABX_P.XBRControlMode_Value,
23163 L4_MABX_B.XBRPassThroughActive, L4_MABX_P.XBRUrgency_Value,
23164 L4_MABX_P.XBRPassThroughEnabled_Value, &L4_MABX_B.If_Then_Else_dq);
23165
23166 /* End of Outputs for SubSystem: '<S1015>/If_Then_Else' */
23167
23168 /* DataTypeConversion: '<S1018>/Data Type Conversion1' */
23169 L4_MABX_B.DataTypeConversion1_ej = (real_T)
23170 L4_MABX_B.If_Then_Else_dq.XBREnduranceBrakeIntegrationMod;
23171
23172 /* DataTypeConversion: '<S1018>/Data Type Conversion2' */
23173 L4_MABX_B.DataTypeConversion2_m = (real_T)
23174 L4_MABX_B.If_Then_Else_dq.XBRPriority;
23175
23176 /* DataTypeConversion: '<S1018>/Data Type Conversion3' */
23177 L4_MABX_B.DataTypeConversion3_b = (real_T)
23178 L4_MABX_B.If_Then_Else_dq.XBRControlMode;
23179
23180 /* DataTypeConversion: '<S1018>/Data Type Conversion4' */
23181 L4_MABX_B.DataTypeConversion4_l =
23182 L4_MABX_B.If_Then_Else_dq.XBRExternalAccelDemand;
23183
23184 /* DataTypeConversion: '<S1018>/Data Type Conversion5' */
23185 L4_MABX_B.DataTypeConversion5_l = (real_T)
23186 L4_MABX_B.If_Then_Else_dq.XBRPassThroughActive;
23187
23188 /* DataTypeConversion: '<S1018>/Data Type Conversion6' */
23189 L4_MABX_B.DataTypeConversion6_b = L4_MABX_B.If_Then_Else_dq.XBRUrgency;
23190
23191 /* DataTypeConversion: '<S1018>/Data Type Conversion7' */
23192 L4_MABX_B.DataTypeConversion7_o =
23193 L4_MABX_B.If_Then_Else_dq.XBRPassThroughEnabled;
23194
23195 /* UnitDelay: '<S1011>/Unit_Delay' */
23196 L4_MABX_B.Unit_Delay_i = L4_MABX_DW.Unit_Delay_DSTATE_bm;
23197
23198 /* Logic: '<S1011>/Logical Operator8' */
23199 L4_MABX_B.LogicalOperator8_k = !L4_MABX_B.TmpRTBAtLogicalOperator8Inport1;
23200
23201 /* Logic: '<S1011>/Logical Operator7' */
23202 L4_MABX_B.LogicalOperator7_p = (L4_MABX_B.Unit_Delay_i &&
23203 L4_MABX_B.LogicalOperator8_k);
23204
23205 /* Logic: '<S1011>/Logical Operator1' */
23206 L4_MABX_B.LogicalOperator1_n = (L4_MABX_B.LogicalOperator7_p ||
23207 L4_MABX_B.TmpRTBAtLogicalOperator1Inport2);
23208
23209 /* DataTypeConversion: '<S1011>/Data Type Conversion' incorporates:
23210 * Constant: '<S855>/CANT_PROPB_XBR_B3_CHANNEL_APV'
23211 */
23212 u0 = L4_MABX_P.CANT_PROPB_XBR_B3_CHANNEL_APV_V;
23213 if (u0 < 256.0) {
23214 if (u0 >= 0.0) {
23215 tmp = (uint8_T)u0;
23216 } else {
23217 tmp = 0U;
23218 }
23219 } else {
23220 tmp = MAX_uint8_T;
23221 }
23222
23223 L4_MABX_B.DataTypeConversion_cw = tmp;
23224
23225 /* End of DataTypeConversion: '<S1011>/Data Type Conversion' */
23226
23227 /* S-Function (sfix_bitop): '<S1016>/Operator' */
23228 L4_MABX_B.Operator_gj = (uint8_T)(L4_MABX_B.DataTypeConversion_cw &
23229 L4_MABX_P.Operator_BitMask_f);
23230
23231 /* DataTypeConversion: '<S1016>/DataType' */
23232 L4_MABX_B.DataType_hz = L4_MABX_B.Operator_gj;
23233
23234 /* DataTypeConversion: '<S1011>/Data Type Conversion2' */
23235 L4_MABX_B.DataTypeConversion2_lj = (L4_MABX_B.DataType_hz != 0);
23236
23237 /* Logic: '<S1011>/Logical Operator' */
23238 L4_MABX_B.LogicalOperator_ij = (L4_MABX_B.LogicalOperator1_n &&
23239 L4_MABX_B.DataTypeConversion2_lj);
23240
23241 /* Outputs for Enabled SubSystem: '<S1018>/PropB_XBR_B3' incorporates:
23242 * EnablePort: '<S1019>/Enable'
23243 */
23244 if (L4_MABX_B.LogicalOperator_ij) {
23245 /* S-Function (rti_commonblock): '<S1019>/S-Function1' */
23246 /* This comment workarounds a code generation problem */
23247
23248 /* dSPACE RTICAN TX Message Block: "PropB_XBR_B3" Id:218038707 */
23249 {
23250 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
23251
23252 Float32 delayTime = 0.0;
23253
23254 /* ... Read status and timestamp info (previous message) */
23255 can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]);
23256
23257 /* Convert timestamp */
23258 if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->processed) {
23259 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp =
23260 rtk_dsts_time_to_simtime_convert
23261 (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp);
23262 }
23263
23264 /* Messages with timestamp zero have been received in pause/stop state
23265 and must not be handled.
23266 */
23267 if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp > 0.0) {
23268 L4_MABX_B.SFunction1_o1_hw = (real_T)
23269 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->processed;
23270 L4_MABX_B.SFunction1_o2_c = (real_T)
23271 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->timestamp;
23272 L4_MABX_B.SFunction1_o3_l = (real_T)
23273 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->deltatime;
23274 L4_MABX_B.SFunction1_o4_g = (real_T)
23275 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3]->delaytime;
23276 }
23277
23278 /* ... Encode Simulink signals of TX and RM blocks*/
23279 {
23280 rtican_Signal_t CAN_Sgn;
23281
23282 /* ...... "SPN2920_ExternalAccelerationDemand" (0|16, standard signal, unsigned int, little endian) */
23283 /* Add or substract 0.5 in order to round to nearest integer */
23284 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion4_l -
23285 ( -15.687 ) ) / 0.00048828125 + 0.5);
23286 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
23287 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
23288 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1;
23289
23290 /* ...... "SPN2915_XBREnduranceBrkIntegrationMode" (16|2, standard signal, unsigned int, little endian) */
23291 /* Add or substract 0.5 in order to round to nearest integer */
23292 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_ej ) +
23293 0.5);
23294 CAN_Sgn.UnsignedSgn &= 0x00000003;
23295 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
23296
23297 /* ...... "SPN2915_XBRPriority" (18|2, standard signal, unsigned int, little endian) */
23298 /* Add or substract 0.5 in order to round to nearest integer */
23299 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_m ) +
23300 0.5);
23301 CAN_Sgn.UnsignedSgn &= 0x00000003;
23302 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
23303 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
23304
23305 /* ...... "SPN2916_XBRControlMode" (20|2, standard signal, unsigned int, little endian) */
23306 /* Add or substract 0.5 in order to round to nearest integer */
23307 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion3_b ) +
23308 0.5);
23309 CAN_Sgn.UnsignedSgn &= 0x00000003;
23310 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
23311 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
23312
23313 /* ...... "XBRPassThroughActive" (22|2, standard signal, unsigned int, little endian) */
23314 /* Add or substract 0.5 in order to round to nearest integer */
23315 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion5_l ) +
23316 0.5);
23317 CAN_Sgn.UnsignedSgn &= 0x00000003;
23318 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
23319 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
23320
23321 /* ...... "SPN4099_XBRUrgency" (24|8, standard signal, unsigned int, little endian) */
23322 /* Add or substract 0.5 in order to round to nearest integer */
23323 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion6_b - ( 0 )
23324 ) / 0.4 + 0.5);
23325 CAN_Sgn.UnsignedSgn &= 0x000000FF;
23326 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
23327
23328 /* ...... "XBRPassThroughEnable" (54|2, standard signal, unsigned int, little endian) */
23329 /* Add or substract 0.5 in order to round to nearest integer */
23330 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion7_o ) +
23331 0.5);
23332 CAN_Sgn.UnsignedSgn &= 0x00000003;
23333 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
23334 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
23335 }
23336
23337 /* mask unused bits with '1' */
23338 CAN_Msg[4] |= 0xFF;
23339 CAN_Msg[5] |= 0xFF;
23340 CAN_Msg[6] |= 0x3F;
23341 CAN_Msg[7] |= 0xFF;
23342
23343 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
23344 can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3], 8,
23345 &(CAN_Msg[0]), delayTime);
23346 }
23347 }
23348
23349 /* End of Outputs for SubSystem: '<S1018>/PropB_XBR_B3' */
23350
23351 /* RelationalOperator: '<S1017>/Compare' incorporates:
23352 * Constant: '<S1017>/Constant'
23353 */
23354 L4_MABX_B.Compare_p2 = (L4_MABX_B.If_Then_Else_dq.XBRPassThroughActive ==
23355 L4_MABX_P.CompareToConstant_const_j);
23356
23357 /* Saturate: '<S1014>/Saturation' incorporates:
23358 * Constant: '<S1014>/2C2_OR_VALUE_APV'
23359 */
23360 u0 = L4_MABX_P.uC2_OR_VALUE_APV_Value;
23361 u1 = L4_MABX_P.Saturation_LowerSat_gb;
23362 u2 = L4_MABX_P.Saturation_UpperSat_k;
23363 if (u0 > u2) {
23364 L4_MABX_B.Saturation_d = u2;
23365 } else if (u0 < u1) {
23366 L4_MABX_B.Saturation_d = u1;
23367 } else {
23368 L4_MABX_B.Saturation_d = u0;
23369 }
23370
23371 /* End of Saturate: '<S1014>/Saturation' */
23372
23373 /* Outputs for Atomic SubSystem: '<S1014>/If_Then_Else1' */
23374
23375 /* Constant: '<S1014>/F_2C2_OR_APV' */
23376 L4_MABX_If_Then_Else_g(L4_MABX_P.F_2C2_OR_APV_Value, L4_MABX_B.Saturation_d,
23377 L4_MABX_B.BrakingPID_Y_kq, &L4_MABX_B.If_Then_Else1_ep);
23378
23379 /* End of Outputs for SubSystem: '<S1014>/If_Then_Else1' */
23380
23381 /* Gain: '<S1014>/Gain' */
23382 L4_MABX_B.Gain_pu = L4_MABX_P.Gain_Gain_ja * L4_MABX_B.If_Then_Else1_ep.Switch;
23383
23384 /* Gain: '<S1031>/Gain' */
23385 L4_MABX_B.Gain_c = L4_MABX_P.Gain_Gain_l * L4_MABX_B.Gain_pu;
23386
23387 /* DataTypeConversion: '<S1031>/Data Type Conversion2' */
23388 u0 = floor(L4_MABX_B.Gain_c);
23389 if (rtIsNaN(u0) || rtIsInf(u0)) {
23390 u0 = 0.0;
23391 } else {
23392 u0 = fmod(u0, 256.0);
23393 }
23394
23395 L4_MABX_B.DataTypeConversion2_fy = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T)
23396 -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0);
23397
23398 /* End of DataTypeConversion: '<S1031>/Data Type Conversion2' */
23399
23400 /* DataTypeConversion: '<S1031>/Data Type Conversion3' incorporates:
23401 * Constant: '<S1014>/BrkControlMode_Active'
23402 */
23403 u0 = floor(L4_MABX_P.BrkControlMode_Active_Value);
23404 if (rtIsNaN(u0) || rtIsInf(u0)) {
23405 u0 = 0.0;
23406 } else {
23407 u0 = fmod(u0, 256.0);
23408 }
23409
23410 L4_MABX_B.DataTypeConversion3_ai = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T)
23411 -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0);
23412
23413 /* End of DataTypeConversion: '<S1031>/Data Type Conversion3' */
23414
23415 /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator14' */
23416 L4_MABX_B.BitwiseOperator14 = (uint8_T)(L4_MABX_B.DataTypeConversion3_ai &
23417 L4_MABX_P.BitwiseOperator14_BitMask);
23418
23419 /* DataTypeConversion: '<S1031>/Data Type Conversion4' incorporates:
23420 * Constant: '<S1014>/BrkControlPriority'
23421 */
23422 u0 = floor(L4_MABX_P.BrkControlPriority_Value);
23423 if (rtIsNaN(u0) || rtIsInf(u0)) {
23424 u0 = 0.0;
23425 } else {
23426 u0 = fmod(u0, 256.0);
23427 }
23428
23429 L4_MABX_B.DataTypeConversion4_j1 = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T)
23430 -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0);
23431
23432 /* End of DataTypeConversion: '<S1031>/Data Type Conversion4' */
23433
23434 /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator1' */
23435 L4_MABX_B.BitwiseOperator1 = (uint8_T)(L4_MABX_B.DataTypeConversion4_j1 &
23436 L4_MABX_P.BitwiseOperator1_BitMask);
23437
23438 /* ArithShift: '<S1031>/Shift_Arithmetic ' */
23439 L4_MABX_B.Shift_Arithmetic_k = (uint8_T)(L4_MABX_B.BitwiseOperator1 << 2);
23440
23441 /* DataTypeConversion: '<S1031>/Data Type Conversion12' */
23442 L4_MABX_B.DataTypeConversion12_e = L4_MABX_B.Shift_Arithmetic_k;
23443
23444 /* DataTypeConversion: '<S1031>/Data Type Conversion6' incorporates:
23445 * Constant: '<S1031>/Constant2'
23446 */
23447 L4_MABX_B.DataTypeConversion6_lq = L4_MABX_P.Constant2_Value_ae;
23448
23449 /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator17' */
23450 L4_MABX_B.BitwiseOperator17_p = (uint8_T)(L4_MABX_B.BitwiseOperator14 |
23451 L4_MABX_B.DataTypeConversion12_e | L4_MABX_B.DataTypeConversion6_lq);
23452
23453 /* Gain: '<S1031>/Gain1' incorporates:
23454 * Constant: '<S1014>/BrkControl_RearAxlePressureProportioning'
23455 */
23456 L4_MABX_B.Gain1_g = L4_MABX_P.Gain1_Gain_h *
23457 L4_MABX_P.BrkControl_RearAxlePressureProp;
23458
23459 /* DataTypeConversion: '<S1031>/Data Type Conversion11' */
23460 u0 = floor(L4_MABX_B.Gain1_g);
23461 if (rtIsNaN(u0) || rtIsInf(u0)) {
23462 u0 = 0.0;
23463 } else {
23464 u0 = fmod(u0, 256.0);
23465 }
23466
23467 L4_MABX_B.DataTypeConversion11_c = (uint8_T)(u0 < 0.0 ? (int32_T)(uint8_T)
23468 -(int8_T)(uint8_T)-u0 : (int32_T)(uint8_T)u0);
23469
23470 /* End of DataTypeConversion: '<S1031>/Data Type Conversion11' */
23471
23472 /* Reshape: '<S1034>/Reshape' incorporates:
23473 * Constant: '<S1034>/Constant'
23474 */
23475 for (i = 0; i < 16; i++) {
23476 L4_MABX_B.Reshape_o[i] = L4_MABX_P.Repeating_Sequence_Stair_Out_dj[i];
23477 }
23478
23479 /* End of Reshape: '<S1034>/Reshape' */
23480
23481 /* UnitDelay: '<S1034>/Unit_Delay' */
23482 L4_MABX_B.Unit_Delay_np = L4_MABX_DW.Unit_Delay_DSTATE_jc;
23483
23484 /* UnitDelay: '<S1035>/Unit Delay' */
23485 L4_MABX_B.UnitDelay_g = L4_MABX_DW.UnitDelay_DSTATE_c;
23486
23487 /* Switch: '<S1038>/Switch1' incorporates:
23488 * Constant: '<S1035>/E'
23489 * Constant: '<S1035>/IV'
23490 * Switch: '<S1037>/Switch1'
23491 */
23492 if (L4_MABX_B.Unit_Delay_np) {
23493 L4_MABX_B.Switch1_au = L4_MABX_P.IV_Value_d;
23494 } else {
23495 if (L4_MABX_P.E_Value_jh) {
23496 /* Sum: '<S1035>/Subtract' incorporates:
23497 * Constant: '<S1035>/Constant'
23498 * Switch: '<S1037>/Switch1'
23499 */
23500 q0 = L4_MABX_P.Constant_Value_gr;
23501 qY = q0 + L4_MABX_B.UnitDelay_g;
23502 if (qY < q0) {
23503 qY = MAX_uint32_T;
23504 }
23505
23506 L4_MABX_B.Subtract_m = qY;
23507
23508 /* End of Sum: '<S1035>/Subtract' */
23509
23510 /* Switch: '<S1037>/Switch1' */
23511 L4_MABX_B.Switch1_mb = L4_MABX_B.Subtract_m;
23512 } else {
23513 /* Switch: '<S1037>/Switch1' */
23514 L4_MABX_B.Switch1_mb = L4_MABX_B.UnitDelay_g;
23515 }
23516
23517 L4_MABX_B.Switch1_au = L4_MABX_B.Switch1_mb;
23518 }
23519
23520 /* End of Switch: '<S1038>/Switch1' */
23521
23522 /* Selector: '<S1034>/Selector' */
23523 L4_MABX_B.Selector_n = L4_MABX_B.Reshape_o[(int32_T)L4_MABX_B.Switch1_au - 1];
23524
23525 /* DataTypeConversion: '<S1031>/Data Type Conversion10' */
23526 L4_MABX_B.DataTypeConversion10_p = L4_MABX_B.Selector_n;
23527
23528 /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator6' */
23529 L4_MABX_B.BitwiseOperator6 = (uint8_T)(L4_MABX_B.DataTypeConversion10_p &
23530 L4_MABX_P.BitwiseOperator6_BitMask);
23531
23532 /* DataTypeConversion: '<S1030>/Data Type Conversion6' incorporates:
23533 * Constant: '<S1030>/Priority'
23534 */
23535 L4_MABX_B.DataTypeConversion6_pl = L4_MABX_P.Priority_Value_l;
23536
23537 /* ArithShift: '<S1030>/Shift_Arithmetic 5' */
23538 L4_MABX_B.Shift_Arithmetic5 = L4_MABX_B.DataTypeConversion6_pl << 26;
23539
23540 /* DataTypeConversion: '<S1030>/Data Type Conversion7' incorporates:
23541 * Constant: '<S1030>/ExtendedDataPage'
23542 */
23543 L4_MABX_B.DataTypeConversion7_k = L4_MABX_P.ExtendedDataPage_Value_p;
23544
23545 /* ArithShift: '<S1030>/Shift_Arithmetic 6' */
23546 L4_MABX_B.Shift_Arithmetic6 = L4_MABX_B.DataTypeConversion7_k << 25;
23547
23548 /* DataTypeConversion: '<S1030>/Data Type Conversion8' incorporates:
23549 * Constant: '<S1030>/DataPage'
23550 */
23551 L4_MABX_B.DataTypeConversion8_d = L4_MABX_P.DataPage_Value_l;
23552
23553 /* ArithShift: '<S1030>/Shift_Arithmetic 7' */
23554 L4_MABX_B.Shift_Arithmetic7 = L4_MABX_B.DataTypeConversion8_d << 24;
23555
23556 /* DataTypeConversion: '<S1030>/Data Type Conversion9' incorporates:
23557 * Constant: '<S1030>/PDUFormat'
23558 */
23559 L4_MABX_B.DataTypeConversion9_f = L4_MABX_P.PDUFormat_Value_p;
23560
23561 /* ArithShift: '<S1030>/Shift_Arithmetic 8' */
23562 L4_MABX_B.Shift_Arithmetic8 = L4_MABX_B.DataTypeConversion9_f << 16;
23563
23564 /* DataTypeConversion: '<S1030>/Data Type Conversion10' incorporates:
23565 * Constant: '<S1030>/PDUSpecific'
23566 */
23567 L4_MABX_B.DataTypeConversion10_d = L4_MABX_P.PDUSpecific_Value_i;
23568
23569 /* ArithShift: '<S1030>/Shift_Arithmetic 9' */
23570 L4_MABX_B.Shift_Arithmetic9 = L4_MABX_B.DataTypeConversion10_d << 8;
23571
23572 /* DataTypeConversion: '<S1030>/Data Type Conversion11' incorporates:
23573 * Constant: '<S1030>/SourceAddress'
23574 */
23575 L4_MABX_B.DataTypeConversion11_e = L4_MABX_P.SourceAddress_Value_i;
23576
23577 /* S-Function (sfix_bitop): '<S1030>/Bitwise Operator17' */
23578 L4_MABX_B.BitwiseOperator17 = L4_MABX_B.Shift_Arithmetic5 |
23579 L4_MABX_B.Shift_Arithmetic6 | L4_MABX_B.Shift_Arithmetic7 |
23580 L4_MABX_B.Shift_Arithmetic8 | L4_MABX_B.Shift_Arithmetic9 |
23581 L4_MABX_B.DataTypeConversion11_e;
23582
23583 /* DataTypeConversion: '<S1031>/Data Type Conversion7' */
23584 L4_MABX_B.DataTypeConversion7_c = L4_MABX_B.BitwiseOperator17;
23585
23586 /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator2' */
23587 L4_MABX_B.BitwiseOperator2 = L4_MABX_B.DataTypeConversion7_c &
23588 L4_MABX_P.BitwiseOperator2_BitMask;
23589
23590 /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator3' */
23591 L4_MABX_B.BitwiseOperator3 = L4_MABX_B.DataTypeConversion7_c &
23592 L4_MABX_P.BitwiseOperator3_BitMask;
23593
23594 /* ArithShift: '<S1031>/Shift_Arithmetic 3' */
23595 L4_MABX_B.Shift_Arithmetic3_h = L4_MABX_B.BitwiseOperator3 >> 8;
23596
23597 /* DataTypeConversion: '<S1031>/Data Type Conversion5' */
23598 L4_MABX_B.DataTypeConversion5_fl = (uint8_T)L4_MABX_B.Shift_Arithmetic3_h;
23599
23600 /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator4' */
23601 L4_MABX_B.BitwiseOperator4 = L4_MABX_B.DataTypeConversion7_c &
23602 L4_MABX_P.BitwiseOperator4_BitMask;
23603
23604 /* ArithShift: '<S1031>/Shift_Arithmetic 4' */
23605 L4_MABX_B.Shift_Arithmetic4_f = L4_MABX_B.BitwiseOperator4 >> 16;
23606
23607 /* DataTypeConversion: '<S1031>/Data Type Conversion8' */
23608 L4_MABX_B.DataTypeConversion8_b = (uint8_T)L4_MABX_B.Shift_Arithmetic4_f;
23609
23610 /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator5' */
23611 L4_MABX_B.BitwiseOperator5 = L4_MABX_B.DataTypeConversion7_c &
23612 L4_MABX_P.BitwiseOperator5_BitMask;
23613
23614 /* ArithShift: '<S1031>/Shift_Arithmetic 5' */
23615 L4_MABX_B.Shift_Arithmetic5_d = L4_MABX_B.BitwiseOperator5 >> 24;
23616
23617 /* DataTypeConversion: '<S1031>/Data Type Conversion9' */
23618 L4_MABX_B.DataTypeConversion9_e = (uint8_T)L4_MABX_B.Shift_Arithmetic5_d;
23619
23620 /* Sum: '<S1031>/Add2' incorporates:
23621 * Constant: '<S1031>/Constant'
23622 * Constant: '<S1031>/Constant1'
23623 * Constant: '<S1031>/Constant3'
23624 * Constant: '<S1031>/Constant4'
23625 */
23626 L4_MABX_B.Add2_d = (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)
23627 (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)
23628 ((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)
23629 (uint8_T)((uint32_T)L4_MABX_B.DataTypeConversion2_fy +
23630 L4_MABX_B.BitwiseOperator17_p) + L4_MABX_B.DataTypeConversion11_c)
23631 + L4_MABX_P.Constant3_Value_fx) + L4_MABX_P.Constant4_Value_fm) +
23632 L4_MABX_P.Constant_Value_id) + L4_MABX_P.Constant1_Value_ld) + (uint8_T)
23633 L4_MABX_B.BitwiseOperator2) + L4_MABX_B.DataTypeConversion5_fl) +
23634 L4_MABX_B.DataTypeConversion8_b) + L4_MABX_B.DataTypeConversion9_e) +
23635 L4_MABX_B.BitwiseOperator6);
23636
23637 /* ArithShift: '<S1031>/Shift_Arithmetic 6' */
23638 L4_MABX_B.Shift_Arithmetic6_p = (uint8_T)((uint32_T)L4_MABX_B.Add2_d >> 4);
23639
23640 /* Sum: '<S1031>/Add3' */
23641 L4_MABX_B.Add3_o = (uint8_T)((uint32_T)L4_MABX_B.Shift_Arithmetic6_p +
23642 L4_MABX_B.Add2_d);
23643
23644 /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator8' */
23645 L4_MABX_B.BitwiseOperator8 = (uint8_T)(L4_MABX_B.Add3_o &
23646 L4_MABX_P.BitwiseOperator8_BitMask);
23647
23648 /* ArithShift: '<S1031>/Shift_Arithmetic 7' */
23649 L4_MABX_B.Shift_Arithmetic7_p = (uint8_T)(L4_MABX_B.BitwiseOperator8 << 4);
23650
23651 /* S-Function (sfix_bitop): '<S1031>/Bitwise Operator7' */
23652 L4_MABX_B.BitwiseOperator7 = (uint8_T)(L4_MABX_B.BitwiseOperator6 |
23653 L4_MABX_B.Shift_Arithmetic7_p);
23654
23655 /* DataTypeConversion: '<S1012>/Data Type Conversion1' incorporates:
23656 * Constant: '<S1031>/Constant'
23657 * Constant: '<S1031>/Constant1'
23658 * Constant: '<S1031>/Constant3'
23659 * Constant: '<S1031>/Constant4'
23660 */
23661 L4_MABX_B.DataTypeConversion1_l[0] = L4_MABX_B.DataTypeConversion2_fy;
23662 L4_MABX_B.DataTypeConversion1_l[1] = L4_MABX_B.BitwiseOperator17_p;
23663 L4_MABX_B.DataTypeConversion1_l[2] = L4_MABX_B.DataTypeConversion11_c;
23664 L4_MABX_B.DataTypeConversion1_l[3] = L4_MABX_P.Constant3_Value_fx;
23665 L4_MABX_B.DataTypeConversion1_l[4] = L4_MABX_P.Constant4_Value_fm;
23666 L4_MABX_B.DataTypeConversion1_l[5] = L4_MABX_P.Constant_Value_id;
23667 L4_MABX_B.DataTypeConversion1_l[6] = L4_MABX_P.Constant1_Value_ld;
23668 L4_MABX_B.DataTypeConversion1_l[7] = L4_MABX_B.BitwiseOperator7;
23669
23670 /* Outputs for Enabled SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' incorporates:
23671 * EnablePort: '<S1021>/Enable'
23672 */
23673 /* Constant: '<S1014>/CPV' */
23674 if (L4_MABX_P.CPV_Value_hc) {
23675 /* S-Function (rti_commonblock): '<S1021>/S-Function1' */
23676 /* This comment workarounds a code generation problem */
23677
23678 /* dSPACE RTICAN TX Message Block: "PropB_Bendix_2C2_XPR" Id:218060389 */
23679 {
23680 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
23681
23682 Float32 delayTime = 0.0;
23683
23684 /* ... Read status and timestamp info (previous message) */
23685 can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]);
23686
23687 /* Convert timestamp */
23688 if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->processed) {
23689 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp =
23690 rtk_dsts_time_to_simtime_convert
23691 (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp);
23692 }
23693
23694 /* Messages with timestamp zero have been received in pause/stop state
23695 and must not be handled.
23696 */
23697 if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp > 0.0) {
23698 L4_MABX_B.SFunction1_o1_ao = (real_T)
23699 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->processed;
23700 L4_MABX_B.SFunction1_o2_n = (real_T)
23701 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->timestamp;
23702 L4_MABX_B.SFunction1_o3_mp = (real_T)
23703 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->deltatime;
23704 L4_MABX_B.SFunction1_o4_k = (real_T)
23705 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665]->delaytime;
23706 }
23707
23708 /* ... Encode Simulink signals of TX and RM blocks*/
23709 {
23710 rtican_Signal_t CAN_Sgn;
23711
23712 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
23713 /* Add or substract 0.5 in order to round to nearest integer */
23714 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_l[0] ) +
23715 0.5);
23716 CAN_Sgn.UnsignedSgn &= 0x000000FF;
23717 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
23718
23719 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
23720 /* Add or substract 0.5 in order to round to nearest integer */
23721 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_l[1] ) +
23722 0.5);
23723 CAN_Sgn.UnsignedSgn &= 0x000000FF;
23724 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
23725
23726 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
23727 /* Add or substract 0.5 in order to round to nearest integer */
23728 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_l[2] ) +
23729 0.5);
23730 CAN_Sgn.UnsignedSgn &= 0x000000FF;
23731 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
23732
23733 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
23734 /* Add or substract 0.5 in order to round to nearest integer */
23735 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_l[3] ) +
23736 0.5);
23737 CAN_Sgn.UnsignedSgn &= 0x000000FF;
23738 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
23739
23740 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
23741 /* Add or substract 0.5 in order to round to nearest integer */
23742 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_l[4] ) +
23743 0.5);
23744 CAN_Sgn.UnsignedSgn &= 0x000000FF;
23745 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
23746
23747 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
23748 /* Add or substract 0.5 in order to round to nearest integer */
23749 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_l[5] ) +
23750 0.5);
23751 CAN_Sgn.UnsignedSgn &= 0x000000FF;
23752 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
23753
23754 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
23755 /* Add or substract 0.5 in order to round to nearest integer */
23756 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_l[6] ) +
23757 0.5);
23758 CAN_Sgn.UnsignedSgn &= 0x000000FF;
23759 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
23760
23761 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
23762 /* Add or substract 0.5 in order to round to nearest integer */
23763 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_l[7] ) +
23764 0.5);
23765 CAN_Sgn.UnsignedSgn &= 0x000000FF;
23766 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
23767 }
23768
23769 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
23770 can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665], 8,
23771 &(CAN_Msg[0]), delayTime);
23772 }
23773 }
23774
23775 /* End of Constant: '<S1014>/CPV' */
23776 /* End of Outputs for SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' */
23777
23778 /* DataTypeConversion: '<S1028>/Data Type Conversion' */
23779 L4_MABX_B.DataTypeConversion_fp = L4_MABX_B.FrontAxleSpeed_e;
23780
23781 /* DataTypeConversion: '<S1028>/Data Type Conversion1' */
23782 L4_MABX_B.DataTypeConversion1_j = L4_MABX_B.SPN1807_SteeringWheelAngle_h;
23783
23784 /* DataTypeConversion: '<S1028>/Data Type Conversion2' */
23785 L4_MABX_B.DataTypeConversion2_a = L4_MABX_B.SPN1808_YawRate_h;
23786
23787 /* DataTypeConversion: '<S1028>/Data Type Conversion3' */
23788 L4_MABX_B.DataTypeConversion3_a = L4_MABX_B.SPN1810_LongitudinalAccelerat_d;
23789
23790 /* DataTypeConversion: '<S1013>/Data Type Conversion' incorporates:
23791 * Constant: '<S855>/CANT_STD_ODOMETRY_CHANNEL_APV'
23792 */
23793 L4_MABX_B.DataTypeConversion_ot = (uint8_T)
23794 L4_MABX_P.CANT_STD_ODOMETRY_CHANNEL_APV_V;
23795
23796 /* S-Function (sfix_bitop): '<S1027>/Operator' */
23797 L4_MABX_B.Operator_ms = (uint8_T)(L4_MABX_B.DataTypeConversion_ot &
23798 L4_MABX_P.Operator_BitMask_os);
23799
23800 /* DataTypeConversion: '<S1027>/DataType' */
23801 L4_MABX_B.DataType = L4_MABX_B.Operator_ms;
23802
23803 /* ArithShift: '<S1013>/Shift_Arithmetic 4' */
23804 L4_MABX_B.Shift_Arithmetic4 = ldexp(L4_MABX_B.DataType, (-5));
23805
23806 /* DataTypeConversion: '<S1013>/Data Type Conversion7' */
23807 L4_MABX_B.DataTypeConversion7_f = (L4_MABX_B.Shift_Arithmetic4 != 0.0);
23808
23809 /* Outputs for Enabled SubSystem: '<S1028>/Std_OdometryData' incorporates:
23810 * EnablePort: '<S1029>/Enable'
23811 */
23812 if (L4_MABX_B.DataTypeConversion7_f) {
23813 /* S-Function (rti_commonblock): '<S1029>/S-Function1' */
23814 /* This comment workarounds a code generation problem */
23815
23816 /* dSPACE RTICAN TX Message Block: "Std_OdometryData" Id:10 */
23817 {
23818 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
23819
23820 Float32 delayTime = 0.0;
23821
23822 /* ... Read status and timestamp info (previous message) */
23823 can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]);
23824
23825 /* Convert timestamp */
23826 if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->processed) {
23827 can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp =
23828 rtk_dsts_time_to_simtime_convert
23829 (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp);
23830 }
23831
23832 /* Messages with timestamp zero have been received in pause/stop state
23833 and must not be handled.
23834 */
23835 if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp > 0.0) {
23836 L4_MABX_B.SFunction1_o1_n = (real_T)
23837 can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->processed;
23838 L4_MABX_B.SFunction1_o2_j3 = (real_T)
23839 can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->timestamp;
23840 L4_MABX_B.SFunction1_o3_g = (real_T)
23841 can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->deltatime;
23842 L4_MABX_B.SFunction1_o4_ev = (real_T)
23843 can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA]->delaytime;
23844 }
23845
23846 /* ... Encode Simulink signals of TX and RM blocks*/
23847 {
23848 rtican_Signal_t CAN_Sgn;
23849
23850 /* ...... "SPN904_FrontAxleSpeed" (0|16, standard signal, unsigned int, little endian) */
23851 /* Add or substract 0.5 in order to round to nearest integer */
23852 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_fp - ( 0 )
23853 ) / 0.00390625 + 0.5);
23854 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
23855 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
23856 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1;
23857
23858 /* ...... "SPN1807_SteeringWheelAngle" (16|16, standard signal, unsigned int, little endian) */
23859 /* Add or substract 0.5 in order to round to nearest integer */
23860 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_j -
23861 ( -31.374 ) ) / 0.0009765625 + 0.5);
23862 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
23863 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
23864 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1;
23865
23866 /* ...... "SPN1808_YawRate" (32|16, standard signal, unsigned int, little endian) */
23867 /* Add or substract 0.5 in order to round to nearest integer */
23868 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_a -
23869 ( -3.92 ) ) / 0.0001220703125 + 0.5);
23870 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
23871 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
23872 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1;
23873
23874 /* ...... "SPN1810_LongitudinalAcceleration" (48|8, standard signal, unsigned int, little endian) */
23875 /* Add or substract 0.5 in order to round to nearest integer */
23876 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion3_a -
23877 ( -12.5 ) ) / 0.1 + 0.5);
23878 CAN_Sgn.UnsignedSgn &= 0x000000FF;
23879 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
23880 }
23881
23882 /* mask unused bits with '1' */
23883 CAN_Msg[7] |= 0xFF;
23884
23885 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
23886 can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA], 8, &(CAN_Msg[0]),
23887 delayTime);
23888 }
23889 }
23890
23891 /* End of Outputs for SubSystem: '<S1028>/Std_OdometryData' */
23892
23893 /* S-Function (sfix_bitop): '<S1022>/Operator' */
23894 L4_MABX_B.Operator_hb = (uint8_T)(L4_MABX_B.DataTypeConversion_ot &
23895 L4_MABX_P.Operator_BitMask_ne);
23896
23897 /* DataTypeConversion: '<S1022>/DataType' */
23898 L4_MABX_B.DataType_ot = L4_MABX_B.Operator_hb;
23899
23900 /* S-Function (sfix_bitop): '<S1023>/Operator' */
23901 L4_MABX_B.Operator_p4 = (uint8_T)(L4_MABX_B.DataTypeConversion_ot &
23902 L4_MABX_P.Operator_BitMask_cef);
23903
23904 /* DataTypeConversion: '<S1023>/DataType' */
23905 L4_MABX_B.DataType_n = L4_MABX_B.Operator_p4;
23906
23907 /* S-Function (sfix_bitop): '<S1024>/Operator' */
23908 L4_MABX_B.Operator_np = (uint8_T)(L4_MABX_B.DataTypeConversion_ot &
23909 L4_MABX_P.Operator_BitMask_nn);
23910
23911 /* DataTypeConversion: '<S1024>/DataType' */
23912 L4_MABX_B.DataType_l = L4_MABX_B.Operator_np;
23913
23914 /* S-Function (sfix_bitop): '<S1025>/Operator' */
23915 L4_MABX_B.Operator_hh = (uint8_T)(L4_MABX_B.DataTypeConversion_ot &
23916 L4_MABX_P.Operator_BitMask_dje);
23917
23918 /* DataTypeConversion: '<S1025>/DataType' */
23919 L4_MABX_B.DataType_f = L4_MABX_B.Operator_hh;
23920
23921 /* S-Function (sfix_bitop): '<S1026>/Operator' */
23922 L4_MABX_B.Operator_jqc = (uint8_T)(L4_MABX_B.DataTypeConversion_ot &
23923 L4_MABX_P.Operator_BitMask_hz);
23924
23925 /* DataTypeConversion: '<S1026>/DataType' */
23926 L4_MABX_B.DataType_g = L4_MABX_B.Operator_jqc;
23927
23928 /* DataTypeConversion: '<S1013>/Data Type Conversion2' */
23929 L4_MABX_B.DataTypeConversion2_l1 = (L4_MABX_B.DataType_ot != 0);
23930
23931 /* ArithShift: '<S1013>/Shift_Arithmetic ' */
23932 L4_MABX_B.Shift_Arithmetic = ldexp(L4_MABX_B.DataType_n, (-1));
23933
23934 /* DataTypeConversion: '<S1013>/Data Type Conversion3' */
23935 L4_MABX_B.DataTypeConversion3_nd = (L4_MABX_B.Shift_Arithmetic != 0.0);
23936
23937 /* ArithShift: '<S1013>/Shift_Arithmetic 1' */
23938 L4_MABX_B.Shift_Arithmetic1 = ldexp(L4_MABX_B.DataType_l, (-2));
23939
23940 /* DataTypeConversion: '<S1013>/Data Type Conversion4' */
23941 L4_MABX_B.DataTypeConversion4_jt = (L4_MABX_B.Shift_Arithmetic1 != 0.0);
23942
23943 /* ArithShift: '<S1013>/Shift_Arithmetic 2' */
23944 L4_MABX_B.Shift_Arithmetic2 = ldexp(L4_MABX_B.DataType_f, (-3));
23945
23946 /* DataTypeConversion: '<S1013>/Data Type Conversion5' */
23947 L4_MABX_B.DataTypeConversion5_hi = (L4_MABX_B.Shift_Arithmetic2 != 0.0);
23948
23949 /* ArithShift: '<S1013>/Shift_Arithmetic 3' */
23950 L4_MABX_B.Shift_Arithmetic3 = ldexp(L4_MABX_B.DataType_g, (-4));
23951
23952 /* DataTypeConversion: '<S1013>/Data Type Conversion6' */
23953 L4_MABX_B.DataTypeConversion6_fb = (L4_MABX_B.Shift_Arithmetic3 != 0.0);
23954
23955 /* RelationalOperator: '<S1036>/Operator' */
23956 L4_MABX_B.Operator_oq = (L4_MABX_B.Switch1_au == L4_MABX_B.Width_h);
23957
23958 /* Lookup_n-D: '<S1015>/DECEL_GOV_XBR_URGENCY_MPV' */
23959 L4_MABX_B.XBRUrgency = look1_binlcapw(L4_MABX_B.XBRExternalAccelDemand,
23960 L4_MABX_P.DECEL_GOV_XBR_URGENCY_MPV_bp01D,
23961 L4_MABX_P.DECEL_GOV_XBR_URGENCY_MPV_table, 7U);
23962
23963 /* End of Outputs for SubSystem: '<S849>/CAN_TX_20ms' */
23964
23965 /* Outputs for Atomic SubSystem: '<S65>/Task_20ms' */
23966 /* RelationalOperator: '<S395>/CheckHDOP' incorporates:
23967 * Constant: '<S395>/MaximumGoodHDOP'
23968 */
23969 L4_MABX_B.CheckHDOP = (L4_MABX_B.HDOP__f <= L4_MABX_P.MaximumGoodHDOP_Value);
23970
23971 /* Gain: '<S395>/kph2mps' */
23972 L4_MABX_B.kph2mps = L4_MABX_P.kph2mps_Gain_l * L4_MABX_B.FrontAxleSpeed_d;
23973
23974 /* Product: '<S395>/Product' incorporates:
23975 * Constant: '<S395>/lookAheadTime'
23976 */
23977 L4_MABX_B.Product_c = L4_MABX_B.kph2mps * L4_MABX_P.lookAheadTime_Value;
23978
23979 /* Gain: '<S395>/kph2mps1' */
23980 L4_MABX_B.kph2mps1 = L4_MABX_P.kph2mps1_Gain * L4_MABX_B.FrontAxleSpeed_dv;
23981
23982 /* Product: '<S395>/Product1' incorporates:
23983 * Constant: '<S395>/lookAheadTime1'
23984 */
23985 L4_MABX_B.Product1_hl = L4_MABX_B.kph2mps1 * L4_MABX_P.lookAheadTime1_Value;
23986
23987 /* UnitDelay: '<S395>/Unit Delay1' */
23988 L4_MABX_B.UnitDelay1 = L4_MABX_DW.UnitDelay1_DSTATE;
23989
23990 /* Constant: '<S396>/InitialHeading' */
23991 L4_MABX_B.InitialHeading = L4_MABX_P.InitialHeading_Value;
23992
23993 /* Constant: '<S396>/InitialPosition' */
23994 L4_MABX_B.InitialPosition = L4_MABX_P.InitialPosition_Value;
23995
23996 /* Constant: '<S396>/InitialXPosition' */
23997 L4_MABX_B.InitialXPosition = L4_MABX_P.InitialXPosition_Value;
23998
23999 /* Constant: '<S396>/InitialYPosition' */
24000 L4_MABX_B.InitialYPosition = L4_MABX_P.InitialYPosition_Value;
24001
24002 /* Gain: '<S71>/kph2ms' */
24003 L4_MABX_B.kph2ms = L4_MABX_P.kph2ms_Gain * L4_MABX_B.FrontAxleSpeed_dvq;
24004
24005 /* DiscreteIntegrator: '<S396>/LongitudnalPosition' incorporates:
24006 * Constant: '<S395>/Constant'
24007 */
24008 if ((L4_MABX_P.Constant_Value_p > 0.0) &&
24009 (L4_MABX_DW.LongitudnalPosition_PrevResetSt <= 0)) {
24010 L4_MABX_DW.LongitudnalPosition_DSTATE = L4_MABX_B.InitialPosition;
24011 }
24012
24013 L4_MABX_B.LongitudnalPosition = L4_MABX_P.LongitudnalPosition_gainval *
24014 L4_MABX_B.kph2ms + L4_MABX_DW.LongitudnalPosition_DSTATE;
24015
24016 /* End of DiscreteIntegrator: '<S396>/LongitudnalPosition' */
24017
24018 /* Trigonometry: '<S396>/Trigonometric Function' */
24019 L4_MABX_B.TrigonometricFunction = sin(L4_MABX_B.kph2ms);
24020
24021 /* Trigonometry: '<S396>/Trigonometric Function1' */
24022 L4_MABX_B.TrigonometricFunction1 = cos(L4_MABX_B.kph2ms);
24023
24024 /* DiscreteIntegrator: '<S396>/VehHeading' incorporates:
24025 * Constant: '<S396>/reset'
24026 */
24027 if ((L4_MABX_P.reset_Value > 0.0) && (L4_MABX_DW.VehHeading_PrevResetState <=
24028 0)) {
24029 L4_MABX_DW.VehHeading_DSTATE = L4_MABX_B.InitialHeading;
24030 }
24031
24032 L4_MABX_B.VehHeading = L4_MABX_P.VehHeading_gainval *
24033 L4_MABX_B.TmpRTBAtVehHeadingInport1 + L4_MABX_DW.VehHeading_DSTATE;
24034
24035 /* End of DiscreteIntegrator: '<S396>/VehHeading' */
24036
24037 /* DiscreteIntegrator: '<S396>/XPosition' incorporates:
24038 * Constant: '<S396>/reset'
24039 */
24040 if ((L4_MABX_P.reset_Value > 0.0) && (L4_MABX_DW.XPosition_PrevResetState <= 0))
24041 {
24042 L4_MABX_DW.XPosition_DSTATE = L4_MABX_B.InitialXPosition;
24043 }
24044
24045 L4_MABX_B.XPosition = L4_MABX_P.XPosition_gainval *
24046 L4_MABX_B.TrigonometricFunction1 + L4_MABX_DW.XPosition_DSTATE;
24047
24048 /* End of DiscreteIntegrator: '<S396>/XPosition' */
24049
24050 /* DiscreteIntegrator: '<S396>/YPosition' incorporates:
24051 * Constant: '<S396>/reset'
24052 */
24053 if ((L4_MABX_P.reset_Value > 0.0) && (L4_MABX_DW.YPosition_PrevResetState <= 0))
24054 {
24055 L4_MABX_DW.YPosition_DSTATE = L4_MABX_B.InitialYPosition;
24056 }
24057
24058 L4_MABX_B.YPosition = L4_MABX_P.YPosition_gainval *
24059 L4_MABX_B.TrigonometricFunction + L4_MABX_DW.YPosition_DSTATE;
24060
24061 /* End of DiscreteIntegrator: '<S396>/YPosition' */
24062 /* End of Outputs for SubSystem: '<S65>/Task_20ms' */
24063
24064 /* UnitDelay: '<S3>/Unit_Delay' */
24065 L4_MABX_B.S = L4_MABX_DW.Unit_Delay_49_DSTATE;
24066 L4_MABX_B.B = L4_MABX_DW.Unit_Delay_50_DSTATE;
24067 L4_MABX_B.X = L4_MABX_DW.Unit_Delay_51_DSTATE;
24068 L4_MABX_B.Y = L4_MABX_DW.Unit_Delay_52_DSTATE;
24069 L4_MABX_B.pathCurveOffset = L4_MABX_DW.Unit_Delay_53_DSTATE;
24070 L4_MABX_B.S_b = L4_MABX_DW.Unit_Delay_54_DSTATE;
24071 L4_MABX_B.distanceSpdTarget = L4_MABX_DW.Unit_Delay_55_DSTATE;
24072 L4_MABX_B.state = L4_MABX_DW.Unit_Delay_56_DSTATE;
24073 L4_MABX_B.lastWayPointIdx = L4_MABX_DW.Unit_Delay_57_DSTATE;
24074 L4_MABX_B.crossed = L4_MABX_DW.Unit_Delay_58_DSTATE;
24075 L4_MABX_B.minimumDist = L4_MABX_DW.Unit_Delay_59_DSTATE;
24076 L4_MABX_B.SrefOnthisPath = L4_MABX_DW.Unit_Delay_60_DSTATE;
24077 L4_MABX_B.StartDist = L4_MABX_DW.Unit_Delay_61_DSTATE;
24078 L4_MABX_B.minDistIdx = L4_MABX_DW.Unit_Delay_62_DSTATE;
24079 L4_MABX_B.pathS = L4_MABX_DW.Unit_Delay_63_DSTATE;
24080 L4_MABX_B.pathLat = L4_MABX_DW.Unit_Delay_64_DSTATE;
24081 L4_MABX_B.pathLong = L4_MABX_DW.Unit_Delay_65_DSTATE;
24082 L4_MABX_B.pathSteeringAngle = L4_MABX_DW.Unit_Delay_66_DSTATE;
24083 L4_MABX_B.pathSpdLimit = L4_MABX_DW.Unit_Delay_67_DSTATE;
24084 L4_MABX_B.distance = L4_MABX_DW.Unit_Delay_68_DSTATE;
24085 L4_MABX_B.idx = L4_MABX_DW.Unit_Delay_69_DSTATE;
24086 L4_MABX_B.wpidx = L4_MABX_DW.Unit_Delay_70_DSTATE;
24087 L4_MABX_B.pathOffset = L4_MABX_DW.Unit_Delay_71_DSTATE;
24088 L4_MABX_B.sRefDistance = L4_MABX_DW.Unit_Delay_72_DSTATE;
24089 L4_MABX_B.refDistance = L4_MABX_DW.Unit_Delay_73_DSTATE;
24090 L4_MABX_B.wpIdx = L4_MABX_DW.Unit_Delay_74_DSTATE;
24091 L4_MABX_B.previewSteeringAngle_l = L4_MABX_DW.Unit_Delay_75_DSTATE;
24092 L4_MABX_B.desHeading = L4_MABX_DW.Unit_Delay_76_DSTATE;
24093 L4_MABX_B.actPreviewDist = L4_MABX_DW.Unit_Delay_77_DSTATE;
24094 L4_MABX_B.desPreviewDist = L4_MABX_DW.Unit_Delay_78_DSTATE;
24095 L4_MABX_B.mappingSearchCase = L4_MABX_DW.Unit_Delay_79_DSTATE;
24096
24097 /* user code (Output function Trailer for TID1) */
24098
24099 /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */
24100 /* EventChannel: 0 */
24101 if (tid == 0) {
24102 DSXCP_service(0);
24103 }
24104
24105 /* If subsystem generates rate grouping Output functions,
24106 * when tid is used in Output function for one rate,
24107 * all Output functions include tid as a local variable.
24108 * As result, some Output functions may have unused tid.
24109 */
24110 UNUSED_PARAMETER(tid);
24111}
24112
24113/* Model update function for TID1 */
24114void L4_MABX_update1(void) /* Sample time: [0.02s, 0.0s] */
24115{
24116 /* Update for Atomic SubSystem: '<S65>/Task_10ms' */
24117 /* Update for RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' incorporates:
24118 * Constant: '<S395>/Constant2'
24119 */
24120 L4_MABX_DW.TmpRTBAtSignalConversion1Inport = L4_MABX_P.Constant2_Value_a;
24121
24122 /* Update for RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' incorporates:
24123 * Constant: '<S395>/Constant13'
24124 */
24125 L4_MABX_DW.TmpRTBAtSignalConversion3Inport = L4_MABX_P.Constant13_Value;
24126
24127 /* Update for RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' incorporates:
24128 * Constant: '<S395>/Constant14'
24129 */
24130 L4_MABX_DW.TmpRTBAtSignalConversion2Inport = L4_MABX_P.Constant14_Value;
24131
24132 /* Update for RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' incorporates:
24133 * Constant: '<S395>/Constant17'
24134 */
24135 L4_MABX_DW.TmpRTBAtrad2deg1Inport1_Buffer0 = L4_MABX_P.Constant17_Value;
24136
24137 /* Update for RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' incorporates:
24138 * Constant: '<S395>/Constant1'
24139 */
24140 L4_MABX_DW.TmpRTBAtsignCurveOffsetInport1_ = L4_MABX_P.Constant1_Value_g;
24141
24142 /* Update for RateTransition: '<S284>/TmpRTBAtAdd2Inport2' incorporates:
24143 * Constant: '<S395>/Constant18'
24144 */
24145 L4_MABX_DW.TmpRTBAtAdd2Inport2_Buffer0 = L4_MABX_P.Constant18_Value;
24146
24147 /* End of Update for SubSystem: '<S65>/Task_10ms' */
24148
24149 /* Update for Atomic SubSystem: '<S849>/CAN_TX_20ms' */
24150
24151 /* Update for UnitDelay: '<S1011>/Unit_Delay' */
24152 L4_MABX_DW.Unit_Delay_DSTATE_bm = L4_MABX_B.TmpRTBAtUnit_DelayInport1;
24153
24154 /* Update for UnitDelay: '<S1034>/Unit_Delay' */
24155 L4_MABX_DW.Unit_Delay_DSTATE_jc = L4_MABX_B.Operator_oq;
24156
24157 /* Update for UnitDelay: '<S1035>/Unit Delay' */
24158 L4_MABX_DW.UnitDelay_DSTATE_c = L4_MABX_B.Switch1_au;
24159
24160 /* End of Update for SubSystem: '<S849>/CAN_TX_20ms' */
24161
24162 /* Update for Atomic SubSystem: '<S65>/Task_20ms' */
24163 /* Update for UnitDelay: '<S395>/Unit Delay1' */
24164 L4_MABX_DW.UnitDelay1_DSTATE = L4_MABX_B.LongitudnalPosition;
24165
24166 /* Update for DiscreteIntegrator: '<S396>/LongitudnalPosition' incorporates:
24167 * Constant: '<S395>/Constant'
24168 */
24169 L4_MABX_DW.LongitudnalPosition_DSTATE = L4_MABX_P.LongitudnalPosition_gainval *
24170 L4_MABX_B.kph2ms + L4_MABX_B.LongitudnalPosition;
24171 if (L4_MABX_P.Constant_Value_p > 0.0) {
24172 L4_MABX_DW.LongitudnalPosition_PrevResetSt = 1;
24173 } else if (L4_MABX_P.Constant_Value_p < 0.0) {
24174 L4_MABX_DW.LongitudnalPosition_PrevResetSt = -1;
24175 } else if (L4_MABX_P.Constant_Value_p == 0.0) {
24176 L4_MABX_DW.LongitudnalPosition_PrevResetSt = 0;
24177 } else {
24178 L4_MABX_DW.LongitudnalPosition_PrevResetSt = 2;
24179 }
24180
24181 /* End of Update for DiscreteIntegrator: '<S396>/LongitudnalPosition' */
24182
24183 /* Update for DiscreteIntegrator: '<S396>/VehHeading' incorporates:
24184 * Constant: '<S396>/reset'
24185 * DiscreteIntegrator: '<S396>/XPosition'
24186 */
24187 L4_MABX_DW.VehHeading_DSTATE = L4_MABX_P.VehHeading_gainval *
24188 L4_MABX_B.TmpRTBAtVehHeadingInport1 + L4_MABX_B.VehHeading;
24189 if (L4_MABX_P.reset_Value > 0.0) {
24190 L4_MABX_DW.VehHeading_PrevResetState = 1;
24191 L4_MABX_DW.XPosition_PrevResetState = 1;
24192 } else {
24193 if (L4_MABX_P.reset_Value < 0.0) {
24194 L4_MABX_DW.VehHeading_PrevResetState = -1;
24195 } else if (L4_MABX_P.reset_Value == 0.0) {
24196 L4_MABX_DW.VehHeading_PrevResetState = 0;
24197 } else {
24198 L4_MABX_DW.VehHeading_PrevResetState = 2;
24199 }
24200
24201 if (L4_MABX_P.reset_Value < 0.0) {
24202 L4_MABX_DW.XPosition_PrevResetState = -1;
24203 } else if (L4_MABX_P.reset_Value == 0.0) {
24204 L4_MABX_DW.XPosition_PrevResetState = 0;
24205 } else {
24206 L4_MABX_DW.XPosition_PrevResetState = 2;
24207 }
24208 }
24209
24210 /* End of Update for DiscreteIntegrator: '<S396>/VehHeading' */
24211
24212 /* Update for DiscreteIntegrator: '<S396>/XPosition' */
24213 L4_MABX_DW.XPosition_DSTATE = L4_MABX_P.XPosition_gainval *
24214 L4_MABX_B.TrigonometricFunction1 + L4_MABX_B.XPosition;
24215
24216 /* Update for DiscreteIntegrator: '<S396>/YPosition' incorporates:
24217 * Constant: '<S396>/reset'
24218 */
24219 L4_MABX_DW.YPosition_DSTATE = L4_MABX_P.YPosition_gainval *
24220 L4_MABX_B.TrigonometricFunction + L4_MABX_B.YPosition;
24221 if (L4_MABX_P.reset_Value > 0.0) {
24222 L4_MABX_DW.YPosition_PrevResetState = 1;
24223 } else if (L4_MABX_P.reset_Value < 0.0) {
24224 L4_MABX_DW.YPosition_PrevResetState = -1;
24225 } else if (L4_MABX_P.reset_Value == 0.0) {
24226 L4_MABX_DW.YPosition_PrevResetState = 0;
24227 } else {
24228 L4_MABX_DW.YPosition_PrevResetState = 2;
24229 }
24230
24231 /* End of Update for DiscreteIntegrator: '<S396>/YPosition' */
24232 /* End of Update for SubSystem: '<S65>/Task_20ms' */
24233
24234 /* Update for UnitDelay: '<S3>/Unit_Delay' incorporates:
24235 * Constant: '<S395>/Constant1'
24236 * Constant: '<S395>/Constant10'
24237 * Constant: '<S395>/Constant11'
24238 * Constant: '<S395>/Constant12'
24239 * Constant: '<S395>/Constant13'
24240 * Constant: '<S395>/Constant14'
24241 * Constant: '<S395>/Constant15'
24242 * Constant: '<S395>/Constant16'
24243 * Constant: '<S395>/Constant17'
24244 * Constant: '<S395>/Constant18'
24245 * Constant: '<S395>/Constant19'
24246 * Constant: '<S395>/Constant2'
24247 * Constant: '<S395>/Constant20'
24248 * Constant: '<S395>/Constant21'
24249 * Constant: '<S395>/Constant22'
24250 * Constant: '<S395>/Constant23'
24251 * Constant: '<S395>/Constant24'
24252 * Constant: '<S395>/Constant25'
24253 * Constant: '<S395>/Constant3'
24254 * Constant: '<S395>/Constant4'
24255 * Constant: '<S395>/Constant5'
24256 * Constant: '<S395>/Constant6'
24257 * Constant: '<S395>/Constant7'
24258 * Constant: '<S395>/Constant8'
24259 * Constant: '<S395>/Constant9'
24260 */
24261 L4_MABX_DW.Unit_Delay_49_DSTATE = L4_MABX_B.LongitudnalPosition;
24262 L4_MABX_DW.Unit_Delay_50_DSTATE = L4_MABX_B.VehHeading;
24263 L4_MABX_DW.Unit_Delay_51_DSTATE = L4_MABX_B.XPosition;
24264 L4_MABX_DW.Unit_Delay_52_DSTATE = L4_MABX_B.YPosition;
24265 L4_MABX_DW.Unit_Delay_53_DSTATE = L4_MABX_P.Constant1_Value_g;
24266 L4_MABX_DW.Unit_Delay_54_DSTATE = L4_MABX_B.UnitDelay1;
24267 L4_MABX_DW.Unit_Delay_55_DSTATE = L4_MABX_P.Constant2_Value_a;
24268 L4_MABX_DW.Unit_Delay_56_DSTATE = L4_MABX_P.Constant3_Value_l;
24269 L4_MABX_DW.Unit_Delay_57_DSTATE = L4_MABX_P.Constant4_Value_m;
24270 L4_MABX_DW.Unit_Delay_58_DSTATE = L4_MABX_P.Constant5_Value_b;
24271 L4_MABX_DW.Unit_Delay_59_DSTATE = L4_MABX_P.Constant10_Value_h;
24272 L4_MABX_DW.Unit_Delay_60_DSTATE = L4_MABX_P.Constant25_Value;
24273 L4_MABX_DW.Unit_Delay_61_DSTATE = L4_MABX_P.Constant6_Value_e;
24274 L4_MABX_DW.Unit_Delay_62_DSTATE = L4_MABX_P.Constant7_Value;
24275 L4_MABX_DW.Unit_Delay_63_DSTATE = L4_MABX_P.Constant8_Value;
24276 L4_MABX_DW.Unit_Delay_64_DSTATE = L4_MABX_P.Constant9_Value_m;
24277 L4_MABX_DW.Unit_Delay_65_DSTATE = L4_MABX_P.Constant11_Value;
24278 L4_MABX_DW.Unit_Delay_66_DSTATE = L4_MABX_P.Constant12_Value;
24279 L4_MABX_DW.Unit_Delay_67_DSTATE = L4_MABX_P.Constant13_Value;
24280 L4_MABX_DW.Unit_Delay_68_DSTATE = L4_MABX_P.Constant14_Value;
24281 L4_MABX_DW.Unit_Delay_69_DSTATE = L4_MABX_P.Constant19_Value_m;
24282 L4_MABX_DW.Unit_Delay_70_DSTATE = L4_MABX_P.Constant16_Value;
24283 L4_MABX_DW.Unit_Delay_71_DSTATE = L4_MABX_P.Constant21_Value_g;
24284 L4_MABX_DW.Unit_Delay_72_DSTATE = L4_MABX_P.Constant22_Value;
24285 L4_MABX_DW.Unit_Delay_73_DSTATE = L4_MABX_P.Constant15_Value;
24286 L4_MABX_DW.Unit_Delay_74_DSTATE = L4_MABX_P.Constant20_Value_i;
24287 L4_MABX_DW.Unit_Delay_75_DSTATE = L4_MABX_P.Constant17_Value;
24288 L4_MABX_DW.Unit_Delay_76_DSTATE = L4_MABX_P.Constant18_Value;
24289 L4_MABX_DW.Unit_Delay_77_DSTATE = L4_MABX_P.Constant23_Value;
24290 L4_MABX_DW.Unit_Delay_78_DSTATE = L4_MABX_B.Product_c;
24291 L4_MABX_DW.Unit_Delay_79_DSTATE = L4_MABX_P.Constant24_Value;
24292}
24293
24294/* Model output function for TID2 */
24295void L4_MABX_output2(void) /* Sample time: [0.05s, 0.0s] */
24296{
24297 int_T tid = 2;
24298
24299 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_50ms' */
24300
24301 /* Outputs for Enabled SubSystem: '<S1054>/CCVS1_E3' incorporates:
24302 * EnablePort: '<S1056>/Enable'
24303 */
24304 /* Constant: '<S858>/enable_CAN_TX_CCVS1_CAN3' */
24305 if (L4_MABX_P.enable_CAN_TX_CCVS1_CAN3_Value > 0.0) {
24306 /* S-Function (rti_commonblock): '<S1056>/S-Function1' */
24307 /* This comment workarounds a code generation problem */
24308
24309 /* dSPACE RTICAN TX Message Block: "CCVS1_E3" Id:419361251 */
24310 {
24311 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
24312
24313 Float32 delayTime = 0.0;
24314
24315 /* ... Read status and timestamp info (previous message) */
24316 can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]);
24317
24318 /* Convert timestamp */
24319 if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->processed) {
24320 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp =
24321 rtk_dsts_time_to_simtime_convert
24322 (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp);
24323 }
24324
24325 /* Messages with timestamp zero have been received in pause/stop state
24326 and must not be handled.
24327 */
24328 if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp > 0.0) {
24329 L4_MABX_B.SFunction1_o1_j = (real_T)
24330 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->processed;
24331 L4_MABX_B.SFunction1_o2_ju = (real_T)
24332 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->timestamp;
24333 L4_MABX_B.SFunction1_o3_d = (real_T)
24334 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->deltatime;
24335 L4_MABX_B.SFunction1_o4_m = (real_T)
24336 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3]->delaytime;
24337 }
24338
24339 /* ... Encode Simulink signals of TX and RM blocks*/
24340 {
24341 rtican_Signal_t CAN_Sgn;
24342
24343 /* ...... "SPN69_TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */
24344 /* Add or substract 0.5 in order to round to nearest integer */
24345 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TwoSpeedAxleSwitch ) + 0.5);
24346 CAN_Sgn.UnsignedSgn &= 0x00000003;
24347 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
24348
24349 /* ...... "SPN70_ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */
24350 /* Add or substract 0.5 in order to round to nearest integer */
24351 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingBrakeSwitch ) + 0.5);
24352 CAN_Sgn.UnsignedSgn &= 0x00000003;
24353 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
24354 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
24355
24356 /* ...... "SPN1633_CruiseControlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */
24357 /* Add or substract 0.5 in order to round to nearest integer */
24358 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlPauseSwitch ) +
24359 0.5);
24360 CAN_Sgn.UnsignedSgn &= 0x00000003;
24361 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
24362 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
24363
24364 /* ...... "SPN3807_ParkBrakeReleaseInhReq" (6|2, standard signal, unsigned int, little endian) */
24365 /* Add or substract 0.5 in order to round to nearest integer */
24366 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkBrakeReleaseInhibitRq )
24367 + 0.5);
24368 CAN_Sgn.UnsignedSgn &= 0x00000003;
24369 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
24370 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
24371
24372 /* ...... "SPN84_WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */
24373 /* Add or substract 0.5 in order to round to nearest integer */
24374 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.WheelBasedVehicleSpeed_j - (
24375 0 ) ) / 0.00390625 + 0.5);
24376 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
24377 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
24378 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1;
24379
24380 /* ...... "SPN595_CruiseControlActive" (24|2, standard signal, unsigned int, little endian) */
24381 /* Add or substract 0.5 in order to round to nearest integer */
24382 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlActive ) + 0.5);
24383 CAN_Sgn.UnsignedSgn &= 0x00000003;
24384 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
24385
24386 /* ...... "SPN596_CruiseControlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */
24387 /* Add or substract 0.5 in order to round to nearest integer */
24388 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlEnableSwitch_i ) +
24389 0.5);
24390 CAN_Sgn.UnsignedSgn &= 0x00000003;
24391 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
24392 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
24393
24394 /* ...... "SPN597_BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */
24395 /* Add or substract 0.5 in order to round to nearest integer */
24396 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakeSwitch_m ) + 0.5);
24397 CAN_Sgn.UnsignedSgn &= 0x00000003;
24398 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
24399 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
24400
24401 /* ...... "SPN598_ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */
24402 /* Add or substract 0.5 in order to round to nearest integer */
24403 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ClutchSwitch ) + 0.5);
24404 CAN_Sgn.UnsignedSgn &= 0x00000003;
24405 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
24406 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
24407
24408 /* ...... "SPN599_CruiseControlSetSwitch" (32|2, standard signal, unsigned int, little endian) */
24409 /* Add or substract 0.5 in order to round to nearest integer */
24410 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSwitch ) + 0.5);
24411 CAN_Sgn.UnsignedSgn &= 0x00000003;
24412 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
24413
24414 /* ...... "SPN600_CruiseControlCoastDecelSw" (34|2, standard signal, unsigned int, little endian) */
24415 /* Add or substract 0.5 in order to round to nearest integer */
24416 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlCoastSwitch ) +
24417 0.5);
24418 CAN_Sgn.UnsignedSgn &= 0x00000003;
24419 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
24420 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
24421
24422 /* ...... "SPN601_CruiseControlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */
24423 /* Add or substract 0.5 in order to round to nearest integer */
24424 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlResumeSwitch ) +
24425 0.5);
24426 CAN_Sgn.UnsignedSgn &= 0x00000003;
24427 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
24428 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
24429
24430 /* ...... "SPN602_CruiseControlAccelerateSw" (38|2, standard signal, unsigned int, little endian) */
24431 /* Add or substract 0.5 in order to round to nearest integer */
24432 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlAccelerateSwitch )
24433 + 0.5);
24434 CAN_Sgn.UnsignedSgn &= 0x00000003;
24435 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
24436 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
24437
24438 /* ...... "SPN86_CruiseControlSetSpeed" (40|8, standard signal, unsigned int, little endian) */
24439 /* Add or substract 0.5 in order to round to nearest integer */
24440 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSpeed ) + 0.5);
24441 CAN_Sgn.UnsignedSgn &= 0x000000FF;
24442 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
24443
24444 /* ...... "SPN976_PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */
24445 /* Add or substract 0.5 in order to round to nearest integer */
24446 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PTOGovernorState ) + 0.5);
24447 CAN_Sgn.UnsignedSgn &= 0x0000001F;
24448 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
24449
24450 /* ...... "SPN527_CruiseControlStates" (53|3, standard signal, unsigned int, little endian) */
24451 /* Add or substract 0.5 in order to round to nearest integer */
24452 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlStates ) + 0.5);
24453 CAN_Sgn.UnsignedSgn &= 0x00000007;
24454 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 5;
24455 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
24456
24457 /* ...... "SPN968_EngIdleIncrementSw" (56|2, standard signal, unsigned int, little endian) */
24458 /* Add or substract 0.5 in order to round to nearest integer */
24459 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleIncrementSwitch ) +
24460 0.5);
24461 CAN_Sgn.UnsignedSgn &= 0x00000003;
24462 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
24463
24464 /* ...... "SPN967_EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */
24465 /* Add or substract 0.5 in order to round to nearest integer */
24466 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleDecrementSwitch ) +
24467 0.5);
24468 CAN_Sgn.UnsignedSgn &= 0x00000003;
24469 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
24470 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
24471
24472 /* ...... "SPN966_EngDiagTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */
24473 /* Add or substract 0.5 in order to round to nearest integer */
24474 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngTestModeSwitch ) + 0.5);
24475 CAN_Sgn.UnsignedSgn &= 0x00000003;
24476 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
24477 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
24478
24479 /* ...... "SPN1237_EngShutdownOvrdSwitch" (62|2, standard signal, unsigned int, little endian) */
24480 /* Add or substract 0.5 in order to round to nearest integer */
24481 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngShutdownOverrideSwitch )
24482 + 0.5);
24483 CAN_Sgn.UnsignedSgn &= 0x00000003;
24484 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
24485 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
24486 }
24487
24488 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
24489 can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3], 8,
24490 &(CAN_Msg[0]), delayTime);
24491 }
24492 }
24493
24494 /* End of Constant: '<S858>/enable_CAN_TX_CCVS1_CAN3' */
24495 /* End of Outputs for SubSystem: '<S1054>/CCVS1_E3' */
24496
24497 /* Outputs for Enabled SubSystem: '<S1055>/TC1_03_05' incorporates:
24498 * EnablePort: '<S1057>/Enable'
24499 */
24500 /* Constant: '<S1055>/CANT_TC1_03_05_APV' */
24501 if (L4_MABX_P.CANT_TC1_03_05_APV_Value) {
24502 /* S-Function (rti_commonblock): '<S1057>/S-Function1' */
24503 /* This comment workarounds a code generation problem */
24504
24505 /* dSPACE RTICAN TX Message Block: "TC1_03_05" Id:201392901 */
24506 {
24507 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
24508
24509 Float32 delayTime = 0.0;
24510
24511 /* ... Read status and timestamp info (previous message) */
24512 can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]);
24513
24514 /* Convert timestamp */
24515 if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->processed) {
24516 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp =
24517 rtk_dsts_time_to_simtime_convert
24518 (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp);
24519 }
24520
24521 /* Messages with timestamp zero have been received in pause/stop state
24522 and must not be handled.
24523 */
24524 if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp > 0.0) {
24525 L4_MABX_B.SFunction1_o1_k = (real_T)
24526 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->processed;
24527 L4_MABX_B.SFunction1_o2_p = (real_T)
24528 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->timestamp;
24529 L4_MABX_B.SFunction1_o3_e = (real_T)
24530 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->deltatime;
24531 L4_MABX_B.SFunction1_o4_e = (real_T)
24532 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305]->delaytime;
24533 }
24534
24535 /* ... Encode Simulink signals of TX and RM blocks*/
24536 {
24537 rtican_Signal_t CAN_Sgn;
24538
24539 /* ...... "SPN681_TransGearShiftInhibitReq" (0|2, standard signal, unsigned int, little endian) */
24540 /* Add or substract 0.5 in order to round to nearest integer */
24541 CAN_Sgn.UnsignedSgn = (UInt32)
24542 (( L4_MABX_B.SPN681_TransGearShiftInhibitReq ) + 0.5);
24543 CAN_Sgn.UnsignedSgn &= 0x00000003;
24544 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
24545
24546 /* ...... "SPN682_TransTrqConvLockupDisReq" (2|2, standard signal, unsigned int, little endian) */
24547 /* Add or substract 0.5 in order to round to nearest integer */
24548 CAN_Sgn.UnsignedSgn = (UInt32)
24549 (( L4_MABX_B.SPN682_TransTrqConvLockupDisReq ) + 0.5);
24550 CAN_Sgn.UnsignedSgn &= 0x00000003;
24551 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
24552 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
24553
24554 /* ...... "SPN683_DisengageDrivelineReq" (4|2, standard signal, unsigned int, little endian) */
24555 /* Add or substract 0.5 in order to round to nearest integer */
24556 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN683_DisengageDrivelineReq
24557 ) + 0.5);
24558 CAN_Sgn.UnsignedSgn &= 0x00000003;
24559 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
24560 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
24561
24562 /* ...... "SPN4242_TransRevGearShiftInhibRq" (6|2, standard signal, unsigned int, little endian) */
24563 /* Add or substract 0.5 in order to round to nearest integer */
24564 CAN_Sgn.UnsignedSgn = (UInt32)
24565 (( L4_MABX_B.SPN4242_TransRevGearShiftInhibR ) + 0.5);
24566 CAN_Sgn.UnsignedSgn &= 0x00000003;
24567 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
24568 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
24569
24570 /* ...... "SPN684_RequestedPercClutchSlip" (8|8, standard signal, unsigned int, little endian) */
24571 /* Add or substract 0.5 in order to round to nearest integer */
24572 CAN_Sgn.UnsignedSgn = (UInt32)
24573 (( L4_MABX_B.SPN684_RequestedPercClutchSlip - ( 0 ) ) / 0.4 + 0.5);
24574 CAN_Sgn.UnsignedSgn &= 0x000000FF;
24575 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
24576
24577 /* ...... "SPN525_TransRequestedGear" (16|8, standard signal, unsigned int, little endian) */
24578 /* Add or substract 0.5 in order to round to nearest integer */
24579 CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.SPN525_TransRequestedGear - (
24580 -125 ) + 0.5);
24581 CAN_Sgn.UnsignedSgn &= 0x000000FF;
24582 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
24583
24584 /* ...... "SPN685_DisengageDiffLockRqFrAx1" (24|2, standard signal, unsigned int, little endian) */
24585 /* Add or substract 0.5 in order to round to nearest integer */
24586 CAN_Sgn.UnsignedSgn = (UInt32)
24587 (( L4_MABX_B.SPN685_DisengageDiffLockRqFrAx1 ) + 0.5);
24588 CAN_Sgn.UnsignedSgn &= 0x00000003;
24589 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
24590
24591 /* ...... "SPN686_DisengageDiffLockRqFrAx2" (26|2, standard signal, unsigned int, little endian) */
24592 /* Add or substract 0.5 in order to round to nearest integer */
24593 CAN_Sgn.UnsignedSgn = (UInt32)
24594 (( L4_MABX_B.SPN686_DisengageDiffLockRqFrAx2 ) + 0.5);
24595 CAN_Sgn.UnsignedSgn &= 0x00000003;
24596 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
24597 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
24598
24599 /* ...... "SPN687_DisengageDiffLockRqRrAx1" (28|2, standard signal, unsigned int, little endian) */
24600 /* Add or substract 0.5 in order to round to nearest integer */
24601 CAN_Sgn.UnsignedSgn = (UInt32)
24602 (( L4_MABX_B.SPN687_DisengageDiffLockRqRrAx1 ) + 0.5);
24603 CAN_Sgn.UnsignedSgn &= 0x00000003;
24604 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
24605 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
24606
24607 /* ...... "SPN688_DisengageDiffLockRqRrAx2" (30|2, standard signal, unsigned int, little endian) */
24608 /* Add or substract 0.5 in order to round to nearest integer */
24609 CAN_Sgn.UnsignedSgn = (UInt32)
24610 (( L4_MABX_B.SPN688_DisengageDiffLockRqRrAx2 ) + 0.5);
24611 CAN_Sgn.UnsignedSgn &= 0x00000003;
24612 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
24613 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
24614
24615 /* ...... "SPN689_DisengageDiffLockRqC" (32|2, standard signal, unsigned int, little endian) */
24616 /* Add or substract 0.5 in order to round to nearest integer */
24617 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN689_DisengageDiffLockRqC )
24618 + 0.5);
24619 CAN_Sgn.UnsignedSgn &= 0x00000003;
24620 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
24621
24622 /* ...... "SPN690_DisengageDiffLockRqCF" (34|2, standard signal, unsigned int, little endian) */
24623 /* Add or substract 0.5 in order to round to nearest integer */
24624 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN690_DisengageDiffLockRqCF
24625 ) + 0.5);
24626 CAN_Sgn.UnsignedSgn &= 0x00000003;
24627 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
24628 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
24629
24630 /* ...... "SPN691_DisengageDiffLockRqCR" (36|2, standard signal, unsigned int, little endian) */
24631 /* Add or substract 0.5 in order to round to nearest integer */
24632 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN691_DisengageDiffLockRqCR
24633 ) + 0.5);
24634 CAN_Sgn.UnsignedSgn &= 0x00000003;
24635 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
24636 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
24637
24638 /* ...... "SPN5762_TransLoadRedInhibitRq" (38|2, standard signal, unsigned int, little endian) */
24639 /* Add or substract 0.5 in order to round to nearest integer */
24640 CAN_Sgn.UnsignedSgn = (UInt32)
24641 (( L4_MABX_B.SPN5762_TransLoadRedInhibitRq ) + 0.5);
24642 CAN_Sgn.UnsignedSgn &= 0x00000003;
24643 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
24644 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
24645
24646 /* ...... "SPN1852_TransmissionMode1" (40|2, standard signal, unsigned int, little endian) */
24647 /* Add or substract 0.5 in order to round to nearest integer */
24648 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1852_TransmissionMode1 )
24649 + 0.5);
24650 CAN_Sgn.UnsignedSgn &= 0x00000003;
24651 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
24652
24653 /* ...... "SPN1853_TransmissionMode2" (42|2, standard signal, unsigned int, little endian) */
24654 /* Add or substract 0.5 in order to round to nearest integer */
24655 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1853_TransmissionMode2 )
24656 + 0.5);
24657 CAN_Sgn.UnsignedSgn &= 0x00000003;
24658 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
24659 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
24660
24661 /* ...... "SPN1854_TransmissionMode3" (44|2, standard signal, unsigned int, little endian) */
24662 /* Add or substract 0.5 in order to round to nearest integer */
24663 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1854_TransmissionMode3 )
24664 + 0.5);
24665 CAN_Sgn.UnsignedSgn &= 0x00000003;
24666 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
24667 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
24668
24669 /* ...... "SPN1855_TransmissionMode4" (46|2, standard signal, unsigned int, little endian) */
24670 /* Add or substract 0.5 in order to round to nearest integer */
24671 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN1855_TransmissionMode4 )
24672 + 0.5);
24673 CAN_Sgn.UnsignedSgn &= 0x00000003;
24674 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
24675 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
24676
24677 /* ...... "SPN7695_TransAutoNeutralRequest" (48|2, standard signal, unsigned int, little endian) */
24678 /* Add or substract 0.5 in order to round to nearest integer */
24679 CAN_Sgn.UnsignedSgn = (UInt32)
24680 (( L4_MABX_B.SPN7695_TransAutoNeutralRequest ) + 0.5);
24681 CAN_Sgn.UnsignedSgn &= 0x00000003;
24682 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
24683
24684 /* ...... "SPN4255_TransRequestedLaunchGear" (50|4, standard signal, unsigned int, little endian) */
24685 /* Add or substract 0.5 in order to round to nearest integer */
24686 CAN_Sgn.UnsignedSgn = (UInt32)
24687 (( L4_MABX_B.SPN4255_TransRequestedLaunchGea ) + 0.5);
24688 CAN_Sgn.UnsignedSgn &= 0x0000000F;
24689 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
24690 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
24691
24692 /* ...... "SPN2985_TransShiftSelDispModeSw" (54|2, standard signal, unsigned int, little endian) */
24693 /* Add or substract 0.5 in order to round to nearest integer */
24694 CAN_Sgn.UnsignedSgn = (UInt32)
24695 (( L4_MABX_B.SPN2985_TransShiftSelDispModeSw ) + 0.5);
24696 CAN_Sgn.UnsignedSgn &= 0x00000003;
24697 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
24698 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
24699
24700 /* ...... "SPN4246_TransmissionMode5" (56|2, standard signal, unsigned int, little endian) */
24701 /* Add or substract 0.5 in order to round to nearest integer */
24702 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4246_TransmissionMode5 )
24703 + 0.5);
24704 CAN_Sgn.UnsignedSgn &= 0x00000003;
24705 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
24706
24707 /* ...... "SPN4247_TransmissionMode6" (58|2, standard signal, unsigned int, little endian) */
24708 /* Add or substract 0.5 in order to round to nearest integer */
24709 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4247_TransmissionMode6 )
24710 + 0.5);
24711 CAN_Sgn.UnsignedSgn &= 0x00000003;
24712 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
24713 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
24714
24715 /* ...... "SPN4248_TransmissionMode7" (60|2, standard signal, unsigned int, little endian) */
24716 /* Add or substract 0.5 in order to round to nearest integer */
24717 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4248_TransmissionMode7 )
24718 + 0.5);
24719 CAN_Sgn.UnsignedSgn &= 0x00000003;
24720 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
24721 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
24722
24723 /* ...... "SPN4249_TransmissionMode8" (62|2, standard signal, unsigned int, little endian) */
24724 /* Add or substract 0.5 in order to round to nearest integer */
24725 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.SPN4249_TransmissionMode8 )
24726 + 0.5);
24727 CAN_Sgn.UnsignedSgn &= 0x00000003;
24728 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
24729 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
24730 }
24731
24732 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
24733 can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305], 8,
24734 &(CAN_Msg[0]), delayTime);
24735 }
24736 }
24737
24738 /* End of Constant: '<S1055>/CANT_TC1_03_05_APV' */
24739 /* End of Outputs for SubSystem: '<S1055>/TC1_03_05' */
24740
24741 /* End of Outputs for SubSystem: '<S849>/CAN_TX_50ms' */
24742 /* user code (Output function Trailer for TID2) */
24743
24744 /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */
24745 /* EventChannel: 0 */
24746 if (tid == 0) {
24747 DSXCP_service(0);
24748 }
24749
24750 /* If subsystem generates rate grouping Output functions,
24751 * when tid is used in Output function for one rate,
24752 * all Output functions include tid as a local variable.
24753 * As result, some Output functions may have unused tid.
24754 */
24755 UNUSED_PARAMETER(tid);
24756}
24757
24758/* Model update function for TID2 */
24759void L4_MABX_update2(void) /* Sample time: [0.05s, 0.0s] */
24760{
24761 /* (no update code required) */
24762}
24763
24764/* Model output function for TID3 */
24765void L4_MABX_output3(void) /* Sample time: [0.1s, 0.0s] */
24766{
24767 int_T tid = 3;
24768 uint16_T tmp;
24769 uint32_T tmp_0;
24770 uint8_T tmp_1;
24771 real_T tmp_2;
24772
24773 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_100ms' */
24774
24775 /* DataTypeConversion: '<S886>/Data Type Conversion' incorporates:
24776 * Constant: '<S853>/PROPB_XPR_INHIBIT_PARK_MANUAL_APV'
24777 */
24778 L4_MABX_B.DataTypeConversion_ikj = (uint8_T)
24779 L4_MABX_P.PROPB_XPR_INHIBIT_PARK_MANUAL_A;
24780
24781 /* S-Function (sfix_bitop): '<S918>/Operator' */
24782 L4_MABX_B.Operator_jr = (uint8_T)(L4_MABX_B.DataTypeConversion_ikj &
24783 L4_MABX_P.Operator_BitMask_ag);
24784
24785 /* DataTypeConversion: '<S918>/DataType' */
24786 L4_MABX_B.DataType_gn = L4_MABX_B.Operator_jr;
24787
24788 /* DataTypeConversion: '<S886>/Data Type Conversion2' incorporates:
24789 * Constant: '<S853>/PROPB_XPR_INHIBIT_UNPARK_MANUAL_APV'
24790 */
24791 L4_MABX_B.DataTypeConversion2_d = (uint8_T)
24792 L4_MABX_P.PROPB_XPR_INHIBIT_UNPARK_MANUAL;
24793
24794 /* S-Function (sfix_bitop): '<S920>/Operator' */
24795 L4_MABX_B.Operator_i3 = (uint8_T)(L4_MABX_B.DataTypeConversion2_d &
24796 L4_MABX_P.Operator_BitMask_js);
24797
24798 /* DataTypeConversion: '<S920>/DataType' */
24799 L4_MABX_B.DataType_a5 = L4_MABX_B.Operator_i3;
24800
24801 /* ArithShift: '<S886>/Shift_Arithmetic ' */
24802 L4_MABX_B.Shift_Arithmetic_m = (uint8_T)(L4_MABX_B.DataType_a5 << 2);
24803
24804 /* DataTypeConversion: '<S886>/Data Type Conversion4' incorporates:
24805 * Constant: '<S853>/PROPB_XPR_PARK_MANUAL_APV'
24806 */
24807 L4_MABX_B.DataTypeConversion4_k = (uint8_T)
24808 L4_MABX_P.PROPB_XPR_PARK_MANUAL_APV_Value;
24809
24810 /* S-Function (sfix_bitop): '<S921>/Operator' */
24811 L4_MABX_B.Operator_m3 = (uint8_T)(L4_MABX_B.DataTypeConversion4_k &
24812 L4_MABX_P.Operator_BitMask_b);
24813
24814 /* DataTypeConversion: '<S921>/DataType' */
24815 L4_MABX_B.DataType_iu = L4_MABX_B.Operator_m3;
24816
24817 /* ArithShift: '<S886>/Shift_Arithmetic 1' */
24818 L4_MABX_B.Shift_Arithmetic1_h = (uint8_T)(L4_MABX_B.DataType_iu << 4);
24819
24820 /* DataTypeConversion: '<S886>/Data Type Conversion5' incorporates:
24821 * Constant: '<S853>/PROPB_XPR_UNPARK_MANUAL_APV'
24822 */
24823 L4_MABX_B.DataTypeConversion5_hw = (uint8_T)
24824 L4_MABX_P.PROPB_XPR_UNPARK_MANUAL_APV_Val;
24825
24826 /* S-Function (sfix_bitop): '<S919>/Operator' */
24827 L4_MABX_B.Operator_cv = (uint8_T)(L4_MABX_B.DataTypeConversion5_hw &
24828 L4_MABX_P.Operator_BitMask_oz);
24829
24830 /* DataTypeConversion: '<S919>/DataType' */
24831 L4_MABX_B.DataType_ku = L4_MABX_B.Operator_cv;
24832
24833 /* ArithShift: '<S886>/Shift_Arithmetic 2' */
24834 L4_MABX_B.Shift_Arithmetic2_a = (uint8_T)(L4_MABX_B.DataType_ku << 6);
24835
24836 /* S-Function (sfix_bitop): '<S926>/Operator' */
24837 L4_MABX_B.Operator_lb = (uint8_T)(L4_MABX_B.DataType_gn |
24838 L4_MABX_B.Shift_Arithmetic_m | L4_MABX_B.Shift_Arithmetic1_h |
24839 L4_MABX_B.Shift_Arithmetic2_a);
24840
24841 /* DataTypeConversion: '<S926>/DataType' */
24842 L4_MABX_B.DataType_mi = L4_MABX_B.Operator_lb;
24843
24844 /* Outputs for Enabled SubSystem: '<S886>/Rolling_15_counter' incorporates:
24845 * EnablePort: '<S928>/Enable'
24846 */
24847 if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_R) {
24848 /* UnitDelay: '<S928>/Unit_Delay' */
24849 L4_MABX_B.Unit_Delay = L4_MABX_DW.Unit_Delay_DSTATE;
24850
24851 /* Sum: '<S936>/FixPt Sum1' incorporates:
24852 * Constant: '<S936>/FixPt Constant'
24853 */
24854 L4_MABX_B.FixPtSum1_a = L4_MABX_B.Unit_Delay + L4_MABX_P.FixPtConstant_Value;
24855
24856 /* Switch: '<S937>/FixPt Switch' incorporates:
24857 * Constant: '<S937>/Constant'
24858 */
24859 if (L4_MABX_B.FixPtSum1_a > L4_MABX_P.WrapToZero1_Threshold) {
24860 L4_MABX_B.FixPtSwitch = L4_MABX_P.Constant_Value_b;
24861 } else {
24862 L4_MABX_B.FixPtSwitch = L4_MABX_B.FixPtSum1_a;
24863 }
24864
24865 /* End of Switch: '<S937>/FixPt Switch' */
24866 }
24867
24868 /* End of Outputs for SubSystem: '<S886>/Rolling_15_counter' */
24869
24870 /* DataTypeConversion: '<S886>/Data Type Conversion1' */
24871 tmp_2 = L4_MABX_B.Unit_Delay;
24872 if (tmp_2 < 256.0) {
24873 if (tmp_2 >= 0.0) {
24874 tmp_1 = (uint8_T)tmp_2;
24875 } else {
24876 tmp_1 = 0U;
24877 }
24878 } else {
24879 tmp_1 = MAX_uint8_T;
24880 }
24881
24882 L4_MABX_B.DataTypeConversion1_nm = tmp_1;
24883
24884 /* End of DataTypeConversion: '<S886>/Data Type Conversion1' */
24885
24886 /* S-Function (sfix_bitop): '<S922>/Operator' */
24887 L4_MABX_B.Operator_hb3 = (uint8_T)(L4_MABX_B.DataTypeConversion1_nm &
24888 L4_MABX_P.Operator_BitMask_ju);
24889
24890 /* DataTypeConversion: '<S922>/DataType' */
24891 L4_MABX_B.DataType_fn = L4_MABX_B.Operator_hb3;
24892
24893 /* DataTypeConversion: '<S925>/Data Type Conversion' incorporates:
24894 * Constant: '<S925>/Priority'
24895 */
24896 L4_MABX_B.DataTypeConversion_ml = L4_MABX_P.Priority_Value;
24897
24898 /* ArithShift: '<S925>/Shift_Arithmetic ' */
24899 L4_MABX_B.Shift_Arithmetic_f = L4_MABX_B.DataTypeConversion_ml << 26;
24900
24901 /* DataTypeConversion: '<S925>/Data Type Conversion1' incorporates:
24902 * Constant: '<S925>/ExtendedDataPage'
24903 */
24904 L4_MABX_B.DataTypeConversion1_f = L4_MABX_P.ExtendedDataPage_Value;
24905
24906 /* ArithShift: '<S925>/Shift_Arithmetic 1' */
24907 L4_MABX_B.Shift_Arithmetic1_o = L4_MABX_B.DataTypeConversion1_f << 25;
24908
24909 /* DataTypeConversion: '<S925>/Data Type Conversion2' incorporates:
24910 * Constant: '<S925>/DataPage'
24911 */
24912 L4_MABX_B.DataTypeConversion2_pu = L4_MABX_P.DataPage_Value;
24913
24914 /* ArithShift: '<S925>/Shift_Arithmetic 2' */
24915 L4_MABX_B.Shift_Arithmetic2_hn = L4_MABX_B.DataTypeConversion2_pu << 24;
24916
24917 /* DataTypeConversion: '<S925>/Data Type Conversion3' incorporates:
24918 * Constant: '<S925>/PDUFormat'
24919 */
24920 L4_MABX_B.DataTypeConversion3_n = L4_MABX_P.PDUFormat_Value;
24921
24922 /* ArithShift: '<S925>/Shift_Arithmetic 3' */
24923 L4_MABX_B.Shift_Arithmetic3_e = L4_MABX_B.DataTypeConversion3_n << 16;
24924
24925 /* DataTypeConversion: '<S925>/Data Type Conversion4' incorporates:
24926 * Constant: '<S925>/PDUSpecific'
24927 */
24928 L4_MABX_B.DataTypeConversion4_ax = L4_MABX_P.PDUSpecific_Value;
24929
24930 /* ArithShift: '<S925>/Shift_Arithmetic 4' */
24931 L4_MABX_B.Shift_Arithmetic4_o4 = L4_MABX_B.DataTypeConversion4_ax << 8;
24932
24933 /* DataTypeConversion: '<S925>/Data Type Conversion5' incorporates:
24934 * Constant: '<S925>/SourceAddress'
24935 */
24936 L4_MABX_B.DataTypeConversion5_h = L4_MABX_P.SourceAddress_Value;
24937
24938 /* S-Function (sfix_bitop): '<S935>/Operator' */
24939 L4_MABX_B.Operator_jd = L4_MABX_B.Shift_Arithmetic_f |
24940 L4_MABX_B.Shift_Arithmetic1_o | L4_MABX_B.Shift_Arithmetic2_hn |
24941 L4_MABX_B.Shift_Arithmetic3_e | L4_MABX_B.Shift_Arithmetic4_o4 |
24942 L4_MABX_B.DataTypeConversion5_h;
24943
24944 /* DataTypeConversion: '<S935>/DataType' */
24945 L4_MABX_B.DataType_c5 = L4_MABX_B.Operator_jd;
24946
24947 /* DataTypeConversion: '<S924>/Data Type Conversion8' */
24948 L4_MABX_B.DataTypeConversion8_h = L4_MABX_B.DataType_c5;
24949
24950 /* S-Function (sfix_bitop): '<S931>/Operator' */
24951 L4_MABX_B.Operator_ei = L4_MABX_B.DataTypeConversion8_h &
24952 L4_MABX_P.Operator_BitMask_o1;
24953
24954 /* DataTypeConversion: '<S931>/DataType' */
24955 tmp_0 = L4_MABX_B.Operator_ei;
24956 if (tmp_0 > 255U) {
24957 tmp_0 = 255U;
24958 }
24959
24960 L4_MABX_B.DataType_lz = (uint8_T)tmp_0;
24961
24962 /* End of DataTypeConversion: '<S931>/DataType' */
24963
24964 /* S-Function (sfix_bitop): '<S932>/Operator' */
24965 L4_MABX_B.Operator_c = L4_MABX_B.DataTypeConversion8_h &
24966 L4_MABX_P.Operator_BitMask_ez;
24967
24968 /* DataTypeConversion: '<S932>/DataType' */
24969 tmp_0 = L4_MABX_B.Operator_c;
24970 if (tmp_0 > 65535U) {
24971 tmp_0 = 65535U;
24972 }
24973
24974 L4_MABX_B.DataType_cy = (uint16_T)tmp_0;
24975
24976 /* End of DataTypeConversion: '<S932>/DataType' */
24977
24978 /* ArithShift: '<S924>/Shift_Arithmetic 3' */
24979 L4_MABX_B.Shift_Arithmetic3_a = (uint16_T)((uint32_T)L4_MABX_B.DataType_cy >>
24980 8);
24981
24982 /* DataTypeConversion: '<S924>/Data Type Conversion9' */
24983 tmp = L4_MABX_B.Shift_Arithmetic3_a;
24984 if (tmp > 255) {
24985 tmp = 255U;
24986 }
24987
24988 L4_MABX_B.MessageIDMidLowByte = (uint8_T)tmp;
24989
24990 /* End of DataTypeConversion: '<S924>/Data Type Conversion9' */
24991
24992 /* S-Function (sfix_bitop): '<S933>/Operator' */
24993 L4_MABX_B.Operator_p = L4_MABX_B.DataTypeConversion8_h &
24994 L4_MABX_P.Operator_BitMask_de;
24995
24996 /* DataTypeConversion: '<S933>/DataType' */
24997 L4_MABX_B.DataType_ba = L4_MABX_B.Operator_p;
24998
24999 /* ArithShift: '<S924>/Shift_Arithmetic 4' */
25000 L4_MABX_B.Shift_Arithmetic4_b = L4_MABX_B.DataType_ba >> 16;
25001
25002 /* DataTypeConversion: '<S924>/Data Type Conversion10' */
25003 tmp_0 = L4_MABX_B.Shift_Arithmetic4_b;
25004 if (tmp_0 > 255U) {
25005 tmp_0 = 255U;
25006 }
25007
25008 L4_MABX_B.MessageIDMidHighByte = (uint8_T)tmp_0;
25009
25010 /* End of DataTypeConversion: '<S924>/Data Type Conversion10' */
25011
25012 /* S-Function (sfix_bitop): '<S934>/Operator' */
25013 L4_MABX_B.Operator_k = L4_MABX_B.DataTypeConversion8_h &
25014 L4_MABX_P.Operator_BitMask_ht;
25015
25016 /* DataTypeConversion: '<S934>/DataType' */
25017 L4_MABX_B.DataType_fp = L4_MABX_B.Operator_k;
25018
25019 /* ArithShift: '<S924>/Shift_Arithmetic 5' */
25020 L4_MABX_B.Shift_Arithmetic5_m = L4_MABX_B.DataType_fp >> 24;
25021
25022 /* DataTypeConversion: '<S924>/Data Type Conversion11' */
25023 tmp_0 = L4_MABX_B.Shift_Arithmetic5_m;
25024 if (tmp_0 > 255U) {
25025 tmp_0 = 255U;
25026 }
25027
25028 L4_MABX_B.MessageIDHighByte = (uint8_T)tmp_0;
25029
25030 /* End of DataTypeConversion: '<S924>/Data Type Conversion11' */
25031
25032 /* DataTypeConversion: '<S924>/Data Type Conversion13' */
25033 tmp_2 = L4_MABX_B.Unit_Delay;
25034 if (tmp_2 < 256.0) {
25035 if (tmp_2 >= 0.0) {
25036 tmp_1 = (uint8_T)tmp_2;
25037 } else {
25038 tmp_1 = 0U;
25039 }
25040 } else {
25041 tmp_1 = MAX_uint8_T;
25042 }
25043
25044 L4_MABX_B.DataTypeConversion13_k = tmp_1;
25045
25046 /* End of DataTypeConversion: '<S924>/Data Type Conversion13' */
25047
25048 /* S-Function (sfix_bitop): '<S930>/Operator' */
25049 L4_MABX_B.Operator_f3 = (uint8_T)(L4_MABX_B.DataTypeConversion13_k &
25050 L4_MABX_P.Operator_BitMask_gv);
25051
25052 /* DataTypeConversion: '<S930>/DataType' */
25053 L4_MABX_B.DataType_m0 = L4_MABX_B.Operator_f3;
25054
25055 /* Sum: '<S924>/Add' incorporates:
25056 * Constant: '<S886>/Constant3'
25057 */
25058 L4_MABX_B.Checksum = (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)
25059 ((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)
25060 (uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)((uint32_T)(uint8_T)
25061 ((uint32_T)(uint8_T)((uint32_T)L4_MABX_B.DataType_mi +
25062 L4_MABX_P.Constant3_Value_k) + L4_MABX_P.Constant3_Value_k) +
25063 L4_MABX_P.Constant3_Value_k) + L4_MABX_P.Constant3_Value_k) +
25064 L4_MABX_P.Constant3_Value_k) + L4_MABX_P.Constant3_Value_k) +
25065 L4_MABX_B.DataType_lz) + L4_MABX_B.MessageIDMidLowByte) +
25066 L4_MABX_B.MessageIDMidHighByte) + L4_MABX_B.MessageIDHighByte) +
25067 L4_MABX_B.DataType_m0);
25068
25069 /* ArithShift: '<S924>/Shift_Arithmetic 7' */
25070 L4_MABX_B.Shift_Arithmetic7_h = (uint8_T)((uint32_T)L4_MABX_B.Checksum >> 4);
25071
25072 /* Sum: '<S924>/Add1' */
25073 L4_MABX_B.Add1_cz = (uint8_T)((uint32_T)L4_MABX_B.Shift_Arithmetic7_h +
25074 L4_MABX_B.Checksum);
25075
25076 /* S-Function (sfix_bitop): '<S929>/Operator' */
25077 L4_MABX_B.Operator_mw = (uint8_T)(L4_MABX_B.Add1_cz &
25078 L4_MABX_P.Operator_BitMask_kdu);
25079
25080 /* DataTypeConversion: '<S929>/DataType' */
25081 L4_MABX_B.DataType_gq = L4_MABX_B.Operator_mw;
25082
25083 /* DataTypeConversion: '<S886>/Data Type Conversion3' */
25084 L4_MABX_B.DataTypeConversion3_dm = L4_MABX_B.DataType_gq;
25085
25086 /* S-Function (sfix_bitop): '<S923>/Operator' */
25087 L4_MABX_B.Operator_cp = (uint8_T)(L4_MABX_B.DataTypeConversion3_dm &
25088 L4_MABX_P.Operator_BitMask_kh);
25089
25090 /* DataTypeConversion: '<S923>/DataType' */
25091 L4_MABX_B.DataType_ef5 = L4_MABX_B.Operator_cp;
25092
25093 /* ArithShift: '<S886>/Shift_Arithmetic 3' */
25094 L4_MABX_B.Shift_Arithmetic3_mb = (uint8_T)(L4_MABX_B.DataType_ef5 << 4);
25095
25096 /* S-Function (sfix_bitop): '<S927>/Operator' */
25097 L4_MABX_B.Operator_kj = (uint8_T)(L4_MABX_B.DataType_fn |
25098 L4_MABX_B.Shift_Arithmetic3_mb);
25099
25100 /* DataTypeConversion: '<S927>/DataType' */
25101 L4_MABX_B.DataType_ny4 = L4_MABX_B.Operator_kj;
25102
25103 /* DataTypeConversion: '<S881>/Data Type Conversion1' incorporates:
25104 * Constant: '<S886>/Constant3'
25105 */
25106 L4_MABX_B.DataTypeConversion1_p[0] = L4_MABX_B.DataType_mi;
25107 L4_MABX_B.DataTypeConversion1_p[1] = L4_MABX_P.Constant3_Value_k;
25108 L4_MABX_B.DataTypeConversion1_p[2] = L4_MABX_P.Constant3_Value_k;
25109 L4_MABX_B.DataTypeConversion1_p[3] = L4_MABX_P.Constant3_Value_k;
25110 L4_MABX_B.DataTypeConversion1_p[4] = L4_MABX_P.Constant3_Value_k;
25111 L4_MABX_B.DataTypeConversion1_p[5] = L4_MABX_P.Constant3_Value_k;
25112 L4_MABX_B.DataTypeConversion1_p[6] = L4_MABX_P.Constant3_Value_k;
25113 L4_MABX_B.DataTypeConversion1_p[7] = L4_MABX_B.DataType_ny4;
25114
25115 /* DataTypeConversion: '<S881>/Data Type Conversion' incorporates:
25116 * Constant: '<S853>/CANT_PROPB_XPR_FC_CHANNEL_APV'
25117 */
25118 L4_MABX_B.DataTypeConversion_d2 = (uint8_T)
25119 L4_MABX_P.CANT_PROPB_XPR_FC_CHANNEL_APV_V;
25120
25121 /* S-Function (sfix_bitop): '<S896>/Operator' */
25122 L4_MABX_B.Operator_ce = (uint8_T)(L4_MABX_B.DataTypeConversion_d2 &
25123 L4_MABX_P.Operator_BitMask_g);
25124
25125 /* DataTypeConversion: '<S896>/DataType' */
25126 L4_MABX_B.DataType_pw = L4_MABX_B.Operator_ce;
25127
25128 /* DataTypeConversion: '<S881>/Data Type Conversion2' */
25129 L4_MABX_B.DataTypeConversion2_p2 = (L4_MABX_B.DataType_pw != 0);
25130
25131 /* Logic: '<S904>/Operator' */
25132 L4_MABX_B.Operator_bx = (L4_MABX_B.TmpRTBAtOperatorInport1 &&
25133 L4_MABX_B.DataTypeConversion2_p2);
25134
25135 /* DataTypeConversion: '<S904>/DataType' */
25136 L4_MABX_B.DataType_dl = L4_MABX_B.Operator_bx;
25137
25138 /* Outputs for Enabled SubSystem: '<S908>/PropB_XPR_FC' incorporates:
25139 * EnablePort: '<S910>/Enable'
25140 */
25141 if (L4_MABX_B.DataType_dl) {
25142 /* S-Function (rti_commonblock): '<S910>/S-Function1' */
25143 /* This comment workarounds a code generation problem */
25144
25145 /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */
25146 {
25147 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
25148
25149 Float32 delayTime = 0.0;
25150
25151 /* ... Read status and timestamp info (previous message) */
25152 can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]);
25153
25154 /* Convert timestamp */
25155 if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->processed) {
25156 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp =
25157 rtk_dsts_time_to_simtime_convert
25158 (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp);
25159 }
25160
25161 /* Messages with timestamp zero have been received in pause/stop state
25162 and must not be handled.
25163 */
25164 if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp > 0.0) {
25165 L4_MABX_B.SFunction1_o1_o = (real_T)
25166 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->processed;
25167 L4_MABX_B.SFunction1_o2_nm = (real_T)
25168 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->timestamp;
25169 L4_MABX_B.SFunction1_o3_lz = (real_T)
25170 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->deltatime;
25171 L4_MABX_B.SFunction1_o4_d = (real_T)
25172 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC]->delaytime;
25173 }
25174
25175 /* ... Encode Simulink signals of TX and RM blocks*/
25176 {
25177 rtican_Signal_t CAN_Sgn;
25178
25179 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
25180 /* Add or substract 0.5 in order to round to nearest integer */
25181 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[0] ) +
25182 0.5);
25183 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25184 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25185
25186 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
25187 /* Add or substract 0.5 in order to round to nearest integer */
25188 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[1] ) +
25189 0.5);
25190 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25191 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
25192
25193 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
25194 /* Add or substract 0.5 in order to round to nearest integer */
25195 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[2] ) +
25196 0.5);
25197 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25198 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
25199
25200 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
25201 /* Add or substract 0.5 in order to round to nearest integer */
25202 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[3] ) +
25203 0.5);
25204 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25205 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
25206
25207 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
25208 /* Add or substract 0.5 in order to round to nearest integer */
25209 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[4] ) +
25210 0.5);
25211 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25212 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25213
25214 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
25215 /* Add or substract 0.5 in order to round to nearest integer */
25216 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[5] ) +
25217 0.5);
25218 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25219 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
25220
25221 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
25222 /* Add or substract 0.5 in order to round to nearest integer */
25223 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[6] ) +
25224 0.5);
25225 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25226 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
25227
25228 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
25229 /* Add or substract 0.5 in order to round to nearest integer */
25230 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[7] ) +
25231 0.5);
25232 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25233 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
25234 }
25235
25236 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
25237 can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC], 8,
25238 &(CAN_Msg[0]), delayTime);
25239 }
25240 }
25241
25242 /* End of Outputs for SubSystem: '<S908>/PropB_XPR_FC' */
25243
25244 /* S-Function (sfix_bitop): '<S901>/Operator' */
25245 L4_MABX_B.Operator_gl = (uint8_T)(L4_MABX_B.DataTypeConversion_d2 &
25246 L4_MABX_P.Operator_BitMask_nu);
25247
25248 /* DataTypeConversion: '<S901>/DataType' */
25249 L4_MABX_B.DataType_fr = L4_MABX_B.Operator_gl;
25250
25251 /* ArithShift: '<S881>/Shift_Arithmetic 2' */
25252 L4_MABX_B.Shift_Arithmetic2_d = ldexp(L4_MABX_B.DataType_fr, (-3));
25253
25254 /* DataTypeConversion: '<S881>/Data Type Conversion5' */
25255 L4_MABX_B.DataTypeConversion5_b = (L4_MABX_B.Shift_Arithmetic2_d != 0.0);
25256
25257 /* Logic: '<S907>/Operator' */
25258 L4_MABX_B.Operator_ja = (L4_MABX_B.TmpRTBAtOperatorInport1_o &&
25259 L4_MABX_B.DataTypeConversion5_b);
25260
25261 /* DataTypeConversion: '<S907>/DataType' */
25262 L4_MABX_B.DataType_iq = L4_MABX_B.Operator_ja;
25263
25264 /* Outputs for Enabled SubSystem: '<S909>/PropB_XPR_FC' incorporates:
25265 * EnablePort: '<S911>/Enable'
25266 */
25267 if (L4_MABX_B.DataType_iq) {
25268 /* S-Function (rti_commonblock): '<S911>/S-Function1' */
25269 /* This comment workarounds a code generation problem */
25270
25271 /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */
25272 {
25273 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
25274
25275 Float32 delayTime = 0.0;
25276
25277 /* ... Read status and timestamp info (previous message) */
25278 can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]);
25279
25280 /* Convert timestamp */
25281 if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->processed) {
25282 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp =
25283 rtk_dsts_time_to_simtime_convert
25284 (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp);
25285 }
25286
25287 /* Messages with timestamp zero have been received in pause/stop state
25288 and must not be handled.
25289 */
25290 if (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp > 0.0) {
25291 L4_MABX_B.SFunction1_o1_ag = (real_T)
25292 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->processed;
25293 L4_MABX_B.SFunction1_o2_gg = (real_T)
25294 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->timestamp;
25295 L4_MABX_B.SFunction1_o3_o = (real_T)
25296 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->deltatime;
25297 L4_MABX_B.SFunction1_o4_pe = (real_T)
25298 can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC]->delaytime;
25299 }
25300
25301 /* ... Encode Simulink signals of TX and RM blocks*/
25302 {
25303 rtican_Signal_t CAN_Sgn;
25304
25305 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
25306 /* Add or substract 0.5 in order to round to nearest integer */
25307 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[0] ) +
25308 0.5);
25309 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25310 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25311
25312 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
25313 /* Add or substract 0.5 in order to round to nearest integer */
25314 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[1] ) +
25315 0.5);
25316 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25317 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
25318
25319 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
25320 /* Add or substract 0.5 in order to round to nearest integer */
25321 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[2] ) +
25322 0.5);
25323 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25324 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
25325
25326 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
25327 /* Add or substract 0.5 in order to round to nearest integer */
25328 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[3] ) +
25329 0.5);
25330 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25331 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
25332
25333 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
25334 /* Add or substract 0.5 in order to round to nearest integer */
25335 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[4] ) +
25336 0.5);
25337 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25338 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25339
25340 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
25341 /* Add or substract 0.5 in order to round to nearest integer */
25342 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[5] ) +
25343 0.5);
25344 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25345 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
25346
25347 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
25348 /* Add or substract 0.5 in order to round to nearest integer */
25349 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[6] ) +
25350 0.5);
25351 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25352 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
25353
25354 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
25355 /* Add or substract 0.5 in order to round to nearest integer */
25356 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_p[7] ) +
25357 0.5);
25358 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25359 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
25360 }
25361
25362 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
25363 can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC], 8,
25364 &(CAN_Msg[0]), delayTime);
25365 }
25366 }
25367
25368 /* End of Outputs for SubSystem: '<S909>/PropB_XPR_FC' */
25369
25370 /* S-Function (sfix_bitop): '<S897>/Operator' */
25371 L4_MABX_B.Operator_jh = (uint8_T)(L4_MABX_B.DataTypeConversion_d2 &
25372 L4_MABX_P.Operator_BitMask_au);
25373
25374 /* DataTypeConversion: '<S897>/DataType' */
25375 L4_MABX_B.DataType_m2 = L4_MABX_B.Operator_jh;
25376
25377 /* S-Function (sfix_bitop): '<S902>/Operator' */
25378 L4_MABX_B.Operator_nzu = (uint8_T)(L4_MABX_B.DataTypeConversion_d2 &
25379 L4_MABX_P.Operator_BitMask_ce);
25380
25381 /* DataTypeConversion: '<S902>/DataType' */
25382 L4_MABX_B.DataType_nq = L4_MABX_B.Operator_nzu;
25383
25384 /* ArithShift: '<S881>/Shift_Arithmetic 3' */
25385 L4_MABX_B.Shift_Arithmetic3_b = ldexp(L4_MABX_B.DataType_nq, (-4));
25386
25387 /* DataTypeConversion: '<S881>/Data Type Conversion6' */
25388 L4_MABX_B.DataTypeConversion6_kr = (L4_MABX_B.Shift_Arithmetic3_b != 0.0);
25389
25390 /* Logic: '<S898>/Operator' */
25391 L4_MABX_B.Operator_mo = (L4_MABX_B.TmpRTBAtOperatorInport1_f &&
25392 L4_MABX_B.DataTypeConversion6_kr);
25393
25394 /* DataTypeConversion: '<S898>/DataType' */
25395 L4_MABX_B.DataType_l3 = L4_MABX_B.Operator_mo;
25396
25397 /* S-Function (sfix_bitop): '<S903>/Operator' */
25398 L4_MABX_B.Operator_ch = (uint8_T)(L4_MABX_B.DataTypeConversion_d2 &
25399 L4_MABX_P.Operator_BitMask_dk);
25400
25401 /* DataTypeConversion: '<S903>/DataType' */
25402 L4_MABX_B.DataType_no = L4_MABX_B.Operator_ch;
25403
25404 /* ArithShift: '<S881>/Shift_Arithmetic 4' */
25405 L4_MABX_B.Shift_Arithmetic4_a = ldexp(L4_MABX_B.DataType_no, (-5));
25406
25407 /* DataTypeConversion: '<S881>/Data Type Conversion7' */
25408 L4_MABX_B.DataTypeConversion7_bb = (L4_MABX_B.Shift_Arithmetic4_a != 0.0);
25409
25410 /* Logic: '<S899>/Operator' */
25411 L4_MABX_B.Operator_dlf = (L4_MABX_B.TmpRTBAtOperatorInport1_h &&
25412 L4_MABX_B.DataTypeConversion7_bb);
25413
25414 /* DataTypeConversion: '<S899>/DataType' */
25415 L4_MABX_B.DataType_py = L4_MABX_B.Operator_dlf;
25416
25417 /* S-Function (sfix_bitop): '<S900>/Operator' */
25418 L4_MABX_B.Operator_fz = (uint8_T)(L4_MABX_B.DataTypeConversion_d2 &
25419 L4_MABX_P.Operator_BitMask_jd);
25420
25421 /* DataTypeConversion: '<S900>/DataType' */
25422 L4_MABX_B.DataType_gt = L4_MABX_B.Operator_fz;
25423
25424 /* ArithShift: '<S881>/Shift_Arithmetic ' */
25425 L4_MABX_B.Shift_Arithmetic_n = ldexp(L4_MABX_B.DataType_m2, (-1));
25426
25427 /* DataTypeConversion: '<S881>/Data Type Conversion3' */
25428 L4_MABX_B.DataTypeConversion3_hv = (L4_MABX_B.Shift_Arithmetic_n != 0.0);
25429
25430 /* Logic: '<S905>/Operator' */
25431 L4_MABX_B.Operator_pig = (L4_MABX_B.TmpRTBAtOperatorInport1_c &&
25432 L4_MABX_B.DataTypeConversion3_hv);
25433
25434 /* DataTypeConversion: '<S905>/DataType' */
25435 L4_MABX_B.DataType_oj = L4_MABX_B.Operator_pig;
25436
25437 /* ArithShift: '<S881>/Shift_Arithmetic 1' */
25438 L4_MABX_B.Shift_Arithmetic1_g = ldexp(L4_MABX_B.DataType_gt, (-2));
25439
25440 /* DataTypeConversion: '<S881>/Data Type Conversion4' */
25441 L4_MABX_B.DataTypeConversion4_gind = (L4_MABX_B.Shift_Arithmetic1_g != 0.0);
25442
25443 /* Logic: '<S906>/Operator' */
25444 L4_MABX_B.Operator_lal = (L4_MABX_B.TmpRTBAtOperatorInport1_oe &&
25445 L4_MABX_B.DataTypeConversion4_gind);
25446
25447 /* DataTypeConversion: '<S906>/DataType' */
25448 L4_MABX_B.DataType_jc = L4_MABX_B.Operator_lal;
25449
25450 /* DataTypeConversion: '<S938>/Data Type Conversion' */
25451 L4_MABX_B.DataTypeConversion_c = L4_MABX_B.Latitude__j;
25452
25453 /* DataTypeConversion: '<S938>/Data Type Conversion1' */
25454 L4_MABX_B.DataTypeConversion1_m = L4_MABX_B.Longitude__g;
25455
25456 /* DataTypeConversion: '<S887>/Data Type Conversion2' incorporates:
25457 * Constant: '<S853>/enablePosRapidUpdateTX'
25458 */
25459 L4_MABX_B.DataTypeConversion2_kz = L4_MABX_P.enablePosRapidUpdateTX_Value;
25460
25461 /* Outputs for Enabled SubSystem: '<S938>/Std_PosRapidUpdate_01' incorporates:
25462 * EnablePort: '<S939>/Enable'
25463 */
25464 if (L4_MABX_B.DataTypeConversion2_kz) {
25465 /* S-Function (rti_commonblock): '<S939>/S-Function1' */
25466 /* This comment workarounds a code generation problem */
25467
25468 /* dSPACE RTICAN TX Message Block: "Std_PosRapidUpdate_01" Id:3 */
25469 {
25470 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
25471
25472 Float32 delayTime = 0.0;
25473
25474 /* ... Read status and timestamp info (previous message) */
25475 can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]);
25476
25477 /* Convert timestamp */
25478 if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->processed) {
25479 can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp =
25480 rtk_dsts_time_to_simtime_convert
25481 (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp);
25482 }
25483
25484 /* Messages with timestamp zero have been received in pause/stop state
25485 and must not be handled.
25486 */
25487 if (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp > 0.0) {
25488 L4_MABX_B.SFunction1_o1_ko = (real_T)
25489 can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->processed;
25490 L4_MABX_B.SFunction1_o2_jw = (real_T)
25491 can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->timestamp;
25492 L4_MABX_B.SFunction1_o3_mo = (real_T)
25493 can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->deltatime;
25494 L4_MABX_B.SFunction1_o4_a = (real_T)
25495 can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3]->delaytime;
25496 }
25497
25498 /* ... Encode Simulink signals of TX and RM blocks*/
25499 {
25500 rtican_Signal_t CAN_Sgn;
25501
25502 /* ...... "Latitude_" (0|32, standard signal, signed int, little endian) */
25503 /* Add or substract 0.5 in order to round to nearest integer */
25504 if (( L4_MABX_B.DataTypeConversion_c - ( 0 ) ) / 1.0E-7 < -0.5)
25505 CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion_c - ( 0 ) )
25506 / 1.0E-7 - 0.5);
25507 else
25508 CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion_c - ( 0 ) )
25509 / 1.0E-7 + 0.5);
25510 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25511 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte1;
25512 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte2;
25513 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte3;
25514
25515 /* ...... "Longitude_" (32|32, standard signal, signed int, little endian) */
25516 /* Add or substract 0.5 in order to round to nearest integer */
25517 if (( L4_MABX_B.DataTypeConversion1_m - ( 0 ) ) / 1.0E-7 < -0.5)
25518 CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion1_m - ( 0 )
25519 ) / 1.0E-7 - 0.5);
25520 else
25521 CAN_Sgn.SignedSgn = (Int32) (( L4_MABX_B.DataTypeConversion1_m - ( 0 )
25522 ) / 1.0E-7 + 0.5);
25523 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25524 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1;
25525 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte2;
25526 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte3;
25527 }
25528
25529 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
25530 can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3], 8, &(CAN_Msg[0]),
25531 delayTime);
25532 }
25533 }
25534
25535 /* End of Outputs for SubSystem: '<S938>/Std_PosRapidUpdate_01' */
25536
25537 /* Outputs for Enabled SubSystem: '<S889>/CCVS1_00' incorporates:
25538 * EnablePort: '<S891>/Enable'
25539 */
25540 /* Outputs for Enabled SubSystem: '<S888>/CCVS1_00' incorporates:
25541 * EnablePort: '<S890>/Enable'
25542 */
25543 /* Constant: '<S879>/Enable_TX_CCVS1_00' */
25544 if (L4_MABX_P.Enable_TX_CCVS1_00_Value) {
25545 /* S-Function (rti_commonblock): '<S890>/S-Function1' */
25546 /* This comment workarounds a code generation problem */
25547
25548 /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:419361024 */
25549 {
25550 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
25551
25552 Float32 delayTime = 0.0;
25553
25554 /* ... Read status and timestamp info (previous message) */
25555 can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]);
25556
25557 /* Convert timestamp */
25558 if (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->processed) {
25559 can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp =
25560 rtk_dsts_time_to_simtime_convert
25561 (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp);
25562 }
25563
25564 /* Messages with timestamp zero have been received in pause/stop state
25565 and must not be handled.
25566 */
25567 if (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp > 0.0) {
25568 L4_MABX_B.SFunction1_o1_pr = (real_T)
25569 can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->processed;
25570 L4_MABX_B.SFunction1_o2_co = (real_T)
25571 can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->timestamp;
25572 L4_MABX_B.SFunction1_o3_ls = (real_T)
25573 can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->deltatime;
25574 L4_MABX_B.SFunction1_o4_f = (real_T)
25575 can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100]->delaytime;
25576 }
25577
25578 /* ... Encode Simulink signals of TX and RM blocks*/
25579 {
25580 rtican_Signal_t CAN_Sgn;
25581
25582 /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */
25583 /* Add or substract 0.5 in order to round to nearest integer */
25584 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TwoSpeedAxleSwitch_l ) + 0.5);
25585 CAN_Sgn.UnsignedSgn &= 0x00000003;
25586 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25587
25588 /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */
25589 /* Add or substract 0.5 in order to round to nearest integer */
25590 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingBrakeSwitch_h ) + 0.5);
25591 CAN_Sgn.UnsignedSgn &= 0x00000003;
25592 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
25593 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25594
25595 /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */
25596 /* Add or substract 0.5 in order to round to nearest integer */
25597 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlPauseSwitch_h ) +
25598 0.5);
25599 CAN_Sgn.UnsignedSgn &= 0x00000003;
25600 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
25601 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25602
25603 /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */
25604 /* Add or substract 0.5 in order to round to nearest integer */
25605 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkBrakeReleaseInhibitRq_c )
25606 + 0.5);
25607 CAN_Sgn.UnsignedSgn &= 0x00000003;
25608 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
25609 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25610
25611 /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */
25612 /* Add or substract 0.5 in order to round to nearest integer */
25613 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.WheelBasedVehicleSpeed_jj -
25614 ( 0 ) ) / 0.00390625 + 0.5);
25615 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
25616 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
25617 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1;
25618
25619 /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */
25620 /* Add or substract 0.5 in order to round to nearest integer */
25621 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlActive_n ) + 0.5);
25622 CAN_Sgn.UnsignedSgn &= 0x00000003;
25623 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
25624
25625 /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */
25626 /* Add or substract 0.5 in order to round to nearest integer */
25627 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlEnableSwitch_ii )
25628 + 0.5);
25629 CAN_Sgn.UnsignedSgn &= 0x00000003;
25630 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
25631 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
25632
25633 /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */
25634 /* Add or substract 0.5 in order to round to nearest integer */
25635 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakeSwitch_mq ) + 0.5);
25636 CAN_Sgn.UnsignedSgn &= 0x00000003;
25637 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
25638 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
25639
25640 /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */
25641 /* Add or substract 0.5 in order to round to nearest integer */
25642 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ClutchSwitch_i ) + 0.5);
25643 CAN_Sgn.UnsignedSgn &= 0x00000003;
25644 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
25645 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
25646
25647 /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */
25648 /* Add or substract 0.5 in order to round to nearest integer */
25649 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSwitch_l ) +
25650 0.5);
25651 CAN_Sgn.UnsignedSgn &= 0x00000003;
25652 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25653
25654 /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */
25655 /* Add or substract 0.5 in order to round to nearest integer */
25656 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlCoastSwitch_f ) +
25657 0.5);
25658 CAN_Sgn.UnsignedSgn &= 0x00000003;
25659 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
25660 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25661
25662 /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */
25663 /* Add or substract 0.5 in order to round to nearest integer */
25664 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlResumeSwitch_l ) +
25665 0.5);
25666 CAN_Sgn.UnsignedSgn &= 0x00000003;
25667 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
25668 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25669
25670 /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */
25671 /* Add or substract 0.5 in order to round to nearest integer */
25672 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlAccelerateSwitch_c
25673 ) + 0.5);
25674 CAN_Sgn.UnsignedSgn &= 0x00000003;
25675 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
25676 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25677
25678 /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */
25679 /* Add or substract 0.5 in order to round to nearest integer */
25680 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSpeed_j ) + 0.5);
25681 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25682 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
25683
25684 /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */
25685 /* Add or substract 0.5 in order to round to nearest integer */
25686 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PTOGovernorState_m ) + 0.5);
25687 CAN_Sgn.UnsignedSgn &= 0x0000001F;
25688 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
25689
25690 /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */
25691 /* Add or substract 0.5 in order to round to nearest integer */
25692 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlStates_c ) + 0.5);
25693 CAN_Sgn.UnsignedSgn &= 0x00000007;
25694 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 5;
25695 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
25696
25697 /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */
25698 /* Add or substract 0.5 in order to round to nearest integer */
25699 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleIncrementSwitch_k ) +
25700 0.5);
25701 CAN_Sgn.UnsignedSgn &= 0x00000003;
25702 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
25703
25704 /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */
25705 /* Add or substract 0.5 in order to round to nearest integer */
25706 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleDecrementSwitch_c ) +
25707 0.5);
25708 CAN_Sgn.UnsignedSgn &= 0x00000003;
25709 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
25710 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
25711
25712 /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */
25713 /* Add or substract 0.5 in order to round to nearest integer */
25714 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngTestModeSwitch_f ) + 0.5);
25715 CAN_Sgn.UnsignedSgn &= 0x00000003;
25716 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
25717 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
25718
25719 /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */
25720 /* Add or substract 0.5 in order to round to nearest integer */
25721 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngShutdownOverrideSwitch_g )
25722 + 0.5);
25723 CAN_Sgn.UnsignedSgn &= 0x00000003;
25724 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
25725 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
25726 }
25727
25728 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
25729 can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100], 8,
25730 &(CAN_Msg[0]), delayTime);
25731 }
25732
25733 /* S-Function (rti_commonblock): '<S891>/S-Function1' */
25734 /* This comment workarounds a code generation problem */
25735
25736 /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:218034432 */
25737 {
25738 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
25739
25740 Float32 delayTime = 0.0;
25741
25742 /* ... Read status and timestamp info (previous message) */
25743 can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]);
25744
25745 /* Convert timestamp */
25746 if (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->processed) {
25747 can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp =
25748 rtk_dsts_time_to_simtime_convert
25749 (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp);
25750 }
25751
25752 /* Messages with timestamp zero have been received in pause/stop state
25753 and must not be handled.
25754 */
25755 if (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp > 0.0) {
25756 L4_MABX_B.SFunction1_o1_aj = (real_T)
25757 can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->processed;
25758 L4_MABX_B.SFunction1_o2_nb = (real_T)
25759 can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->timestamp;
25760 L4_MABX_B.SFunction1_o3_c = (real_T)
25761 can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->deltatime;
25762 L4_MABX_B.SFunction1_o4_c4 = (real_T)
25763 can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100]->delaytime;
25764 }
25765
25766 /* ... Encode Simulink signals of TX and RM blocks*/
25767 {
25768 rtican_Signal_t CAN_Sgn;
25769
25770 /* ...... "TwoSpeedAxleSwitch" (0|2, standard signal, unsigned int, little endian) */
25771 /* Add or substract 0.5 in order to round to nearest integer */
25772 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TwoSpeedAxleSwitch_l1 ) +
25773 0.5);
25774 CAN_Sgn.UnsignedSgn &= 0x00000003;
25775 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25776
25777 /* ...... "ParkingBrakeSwitch" (2|2, standard signal, unsigned int, little endian) */
25778 /* Add or substract 0.5 in order to round to nearest integer */
25779 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingBrakeSwitch_hd ) +
25780 0.5);
25781 CAN_Sgn.UnsignedSgn &= 0x00000003;
25782 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
25783 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25784
25785 /* ...... "CruiseCtrlPauseSwitch" (4|2, standard signal, unsigned int, little endian) */
25786 /* Add or substract 0.5 in order to round to nearest integer */
25787 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlPauseSwitch_hy ) +
25788 0.5);
25789 CAN_Sgn.UnsignedSgn &= 0x00000003;
25790 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
25791 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25792
25793 /* ...... "ParkBrakeReleaseInhibitRq" (6|2, standard signal, unsigned int, little endian) */
25794 /* Add or substract 0.5 in order to round to nearest integer */
25795 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkBrakeReleaseInhibitRq_cf
25796 ) + 0.5);
25797 CAN_Sgn.UnsignedSgn &= 0x00000003;
25798 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
25799 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
25800
25801 /* ...... "WheelBasedVehicleSpeed" (8|16, standard signal, unsigned int, little endian) */
25802 /* Add or substract 0.5 in order to round to nearest integer */
25803 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.WheelBasedVehicleSpeed_jjn -
25804 ( 0 ) ) / 0.00390625 + 0.5);
25805 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
25806 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
25807 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1;
25808
25809 /* ...... "CruiseCtrlActive" (24|2, standard signal, unsigned int, little endian) */
25810 /* Add or substract 0.5 in order to round to nearest integer */
25811 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlActive_ns ) + 0.5);
25812 CAN_Sgn.UnsignedSgn &= 0x00000003;
25813 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
25814
25815 /* ...... "CruiseCtrlEnableSwitch" (26|2, standard signal, unsigned int, little endian) */
25816 /* Add or substract 0.5 in order to round to nearest integer */
25817 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlEnableSwitch_iim )
25818 + 0.5);
25819 CAN_Sgn.UnsignedSgn &= 0x00000003;
25820 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
25821 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
25822
25823 /* ...... "BrakeSwitch" (28|2, standard signal, unsigned int, little endian) */
25824 /* Add or substract 0.5 in order to round to nearest integer */
25825 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakeSwitch_mq0 ) + 0.5);
25826 CAN_Sgn.UnsignedSgn &= 0x00000003;
25827 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
25828 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
25829
25830 /* ...... "ClutchSwitch" (30|2, standard signal, unsigned int, little endian) */
25831 /* Add or substract 0.5 in order to round to nearest integer */
25832 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ClutchSwitch_ic ) + 0.5);
25833 CAN_Sgn.UnsignedSgn &= 0x00000003;
25834 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
25835 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
25836
25837 /* ...... "CruiseCtrlSetSwitch" (32|2, standard signal, unsigned int, little endian) */
25838 /* Add or substract 0.5 in order to round to nearest integer */
25839 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSwitch_lx ) +
25840 0.5);
25841 CAN_Sgn.UnsignedSgn &= 0x00000003;
25842 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25843
25844 /* ...... "CruiseCtrlCoastSwitch" (34|2, standard signal, unsigned int, little endian) */
25845 /* Add or substract 0.5 in order to round to nearest integer */
25846 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlCoastSwitch_f1 ) +
25847 0.5);
25848 CAN_Sgn.UnsignedSgn &= 0x00000003;
25849 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
25850 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25851
25852 /* ...... "CruiseCtrlResumeSwitch" (36|2, standard signal, unsigned int, little endian) */
25853 /* Add or substract 0.5 in order to round to nearest integer */
25854 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlResumeSwitch_l3 )
25855 + 0.5);
25856 CAN_Sgn.UnsignedSgn &= 0x00000003;
25857 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
25858 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25859
25860 /* ...... "CruiseCtrlAccelerateSwitch" (38|2, standard signal, unsigned int, little endian) */
25861 /* Add or substract 0.5 in order to round to nearest integer */
25862 CAN_Sgn.UnsignedSgn = (UInt32)
25863 (( L4_MABX_B.CruiseCtrlAccelerateSwitch_cw ) + 0.5);
25864 CAN_Sgn.UnsignedSgn &= 0x00000003;
25865 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
25866 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
25867
25868 /* ...... "CruiseCtrlSetSpeed" (40|8, standard signal, unsigned int, little endian) */
25869 /* Add or substract 0.5 in order to round to nearest integer */
25870 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlSetSpeed_jb ) +
25871 0.5);
25872 CAN_Sgn.UnsignedSgn &= 0x000000FF;
25873 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
25874
25875 /* ...... "PTOGovernorState" (48|5, standard signal, unsigned int, little endian) */
25876 /* Add or substract 0.5 in order to round to nearest integer */
25877 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PTOGovernorState_mu ) + 0.5);
25878 CAN_Sgn.UnsignedSgn &= 0x0000001F;
25879 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
25880
25881 /* ...... "CruiseCtrlStates" (53|3, standard signal, unsigned int, little endian) */
25882 /* Add or substract 0.5 in order to round to nearest integer */
25883 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CruiseCtrlStates_cv ) + 0.5);
25884 CAN_Sgn.UnsignedSgn &= 0x00000007;
25885 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 5;
25886 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
25887
25888 /* ...... "EngIdleIncrementSwitch" (56|2, standard signal, unsigned int, little endian) */
25889 /* Add or substract 0.5 in order to round to nearest integer */
25890 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleIncrementSwitch_k0 )
25891 + 0.5);
25892 CAN_Sgn.UnsignedSgn &= 0x00000003;
25893 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
25894
25895 /* ...... "EngIdleDecrementSwitch" (58|2, standard signal, unsigned int, little endian) */
25896 /* Add or substract 0.5 in order to round to nearest integer */
25897 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngIdleDecrementSwitch_cv )
25898 + 0.5);
25899 CAN_Sgn.UnsignedSgn &= 0x00000003;
25900 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
25901 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
25902
25903 /* ...... "EngTestModeSwitch" (60|2, standard signal, unsigned int, little endian) */
25904 /* Add or substract 0.5 in order to round to nearest integer */
25905 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngTestModeSwitch_fw ) + 0.5);
25906 CAN_Sgn.UnsignedSgn &= 0x00000003;
25907 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
25908 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
25909
25910 /* ...... "EngShutdownOverrideSwitch" (62|2, standard signal, unsigned int, little endian) */
25911 /* Add or substract 0.5 in order to round to nearest integer */
25912 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngShutdownOverrideSwitch_gz
25913 ) + 0.5);
25914 CAN_Sgn.UnsignedSgn &= 0x00000003;
25915 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
25916 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
25917 }
25918
25919 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
25920 can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100], 8,
25921 &(CAN_Msg[0]), delayTime);
25922 }
25923 }
25924
25925 /* End of Constant: '<S879>/Enable_TX_CCVS1_00' */
25926 /* End of Outputs for SubSystem: '<S888>/CCVS1_00' */
25927 /* End of Outputs for SubSystem: '<S889>/CCVS1_00' */
25928
25929 /* DataTypeConversion: '<S885>/Data Type Conversion' incorporates:
25930 * Constant: '<S884>/Constant'
25931 */
25932 L4_MABX_B.DataTypeConversion_kg = L4_MABX_P.Constant_Value_k4;
25933
25934 /* DataTypeConversion: '<S885>/Data Type Conversion1' */
25935 L4_MABX_B.DataTypeConversion1_c3 = (uint16_T)L4_MABX_B.DataTypeConversion_kg;
25936
25937 /* S-Function (sfix_bitop): '<S916>/Operator' */
25938 L4_MABX_B.Operator_h3 = (uint16_T)(L4_MABX_B.DataTypeConversion1_c3 &
25939 L4_MABX_P.Operator_BitMask_fh);
25940
25941 /* DataTypeConversion: '<S916>/DataType' */
25942 tmp = L4_MABX_B.Operator_h3;
25943 if (tmp > 255) {
25944 tmp = 255U;
25945 }
25946
25947 L4_MABX_B.DataType_cs = (uint8_T)tmp;
25948
25949 /* End of DataTypeConversion: '<S916>/DataType' */
25950
25951 /* S-Function (sfix_bitop): '<S917>/Operator' */
25952 L4_MABX_B.Operator_dr = (uint16_T)(L4_MABX_B.DataTypeConversion1_c3 &
25953 L4_MABX_P.Operator_BitMask_na);
25954
25955 /* DataTypeConversion: '<S917>/DataType' */
25956 L4_MABX_B.DataType_pq = L4_MABX_B.Operator_dr;
25957
25958 /* ArithShift: '<S885>/Shift_Arithmetic ' */
25959 L4_MABX_B.Shift_Arithmetic_o = (uint16_T)((uint32_T)L4_MABX_B.DataType_pq >> 8);
25960
25961 /* DataTypeConversion: '<S885>/Data Type Conversion2' */
25962 tmp = L4_MABX_B.Shift_Arithmetic_o;
25963 if (tmp > 255) {
25964 tmp = 255U;
25965 }
25966
25967 L4_MABX_B.DataTypeConversion2_es = (uint8_T)tmp;
25968
25969 /* End of DataTypeConversion: '<S885>/Data Type Conversion2' */
25970
25971 /* DataTypeConversion: '<S880>/Data Type Conversion1' incorporates:
25972 * Constant: '<S885>/Constant'
25973 */
25974 L4_MABX_B.DataTypeConversion1_m2[0] = L4_MABX_P.Constant_Value_dl;
25975 L4_MABX_B.DataTypeConversion1_m2[1] = L4_MABX_P.Constant_Value_dl;
25976 L4_MABX_B.DataTypeConversion1_m2[2] = L4_MABX_P.Constant_Value_dl;
25977 L4_MABX_B.DataTypeConversion1_m2[3] = L4_MABX_P.Constant_Value_dl;
25978 L4_MABX_B.DataTypeConversion1_m2[4] = L4_MABX_P.Constant_Value_dl;
25979 L4_MABX_B.DataTypeConversion1_m2[5] = L4_MABX_P.Constant_Value_dl;
25980 L4_MABX_B.DataTypeConversion1_m2[6] = L4_MABX_B.DataType_cs;
25981 L4_MABX_B.DataTypeConversion1_m2[7] = L4_MABX_B.DataTypeConversion2_es;
25982
25983 /* RateTransition: '<S892>/TmpRTBAtHiddenBuf_InsertedFor_PropB_REAX_5_E4_at_inport_10Inport1' */
25984 L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_P = L4_MABX_B.Operator_jhs;
25985
25986 /* Outputs for Enabled SubSystem: '<S892>/PropB_REAX_5_E4' incorporates:
25987 * EnablePort: '<S894>/Enable'
25988 */
25989 if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_P) {
25990 /* S-Function (rti_commonblock): '<S894>/S-Function1' incorporates:
25991 * Constant: '<S892>/Constant'
25992 * Constant: '<S892>/Constant1'
25993 */
25994 /* This comment workarounds a code generation problem */
25995
25996 /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */
25997 {
25998 static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
25999 0x00 };
26000
26001 Float32 delayTime = 0.0;
26002
26003 /* link this pointer to CAN_Msg for use in initialize_io_units() */
26004 CANTP1_PTR_M1_C2_XTD_0x18FFFAE4 = &(CAN_Msg[0]);
26005
26006 /* ... perform loop-back if required */
26007 if (L4_MABX_P.Constant1_Value_jm > 0.5) {
26008 /* ... updating the used tx-clientbuffer */
26009 can_tp1_msg_update_all( CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->module,
26010 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->queue );
26011
26012 /* ... Read status and timestamp info perform loop-back (previous message) */
26013 can_tp1_tx_msg_read_loopback(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4,
26014 8, // datalen
26015 &(CAN_Msg[0]),
26016 CANTP1_RX_SPMSG_M1_C2_XTD);
26017
26018 /* Convert timestamp */
26019 if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->processed) {
26020 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp =
26021 rtk_dsts_time_to_simtime_convert
26022 (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp);
26023 }
26024 } else {
26025 /* ... Read status and timestamp info (previous message) */
26026 can_tp1_msg_read_from_dsmcr(CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4);
26027
26028 /* Convert timestamp */
26029 if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->processed) {
26030 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp =
26031 rtk_dsts_time_to_simtime_convert
26032 (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp);
26033 }
26034 }
26035
26036 /* Messages with timestamp zero have been received in pause/stop state
26037 and must not be handled.
26038 */
26039 if (CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp > 0.0) {
26040 L4_MABX_B.SFunction1_o1_ev = (real_T)
26041 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->processed;
26042 L4_MABX_B.SFunction1_o2_h = (real_T)
26043 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->timestamp;
26044 L4_MABX_B.SFunction1_o3_hm = (real_T)
26045 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->deltatime;
26046 L4_MABX_B.SFunction1_o4_l = (real_T)
26047 CANTP1_TX_M1_C2_MCRCLT_XTD_0X18FFFAE4->delaytime;
26048 }
26049
26050 /* ... Encode Simulink signals of TX and RM blocks*/
26051 {
26052 rtican_Signal_t CAN_Sgn;
26053 UInt32 i;
26054
26055 /* Initialize the static message data to zero */
26056 for (i=0; i<8; i++ )
26057 CAN_Msg[i] = 0;
26058
26059 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
26060 /* Add or substract 0.5 in order to round to nearest integer */
26061 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[0] )
26062 + 0.5);
26063 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26064 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
26065
26066 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
26067 /* Add or substract 0.5 in order to round to nearest integer */
26068 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[1] )
26069 + 0.5);
26070 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26071 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
26072
26073 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
26074 /* Add or substract 0.5 in order to round to nearest integer */
26075 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[2] )
26076 + 0.5);
26077 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26078 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
26079
26080 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
26081 /* Add or substract 0.5 in order to round to nearest integer */
26082 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[3] )
26083 + 0.5);
26084 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26085 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
26086
26087 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
26088 /* Add or substract 0.5 in order to round to nearest integer */
26089 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[4] )
26090 + 0.5);
26091 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26092 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
26093
26094 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
26095 /* Add or substract 0.5 in order to round to nearest integer */
26096 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[5] )
26097 + 0.5);
26098 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26099 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
26100
26101 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
26102 /* Add or substract 0.5 in order to round to nearest integer */
26103 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[6] )
26104 + 0.5);
26105 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26106 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
26107
26108 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
26109 /* Add or substract 0.5 in order to round to nearest integer */
26110 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[7] )
26111 + 0.5);
26112 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26113 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
26114 }
26115
26116 delayTime = (Float32) L4_MABX_P.Constant_Value_oy / (1700);
26117
26118 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
26119 can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFFAE4], 8,
26120 &(CAN_Msg[0]), delayTime);
26121 }
26122 }
26123
26124 /* End of Outputs for SubSystem: '<S892>/PropB_REAX_5_E4' */
26125
26126 /* RateTransition: '<S893>/TmpRTBAtHiddenBuf_InsertedFor_PropB_REAX_5_E4_at_inport_10Inport1' */
26127 L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_j = L4_MABX_B.EnablePropB_ReAX_CAN6;
26128
26129 /* Outputs for Enabled SubSystem: '<S893>/PropB_REAX_5_E4' incorporates:
26130 * EnablePort: '<S895>/Enable'
26131 */
26132 if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_j) {
26133 /* S-Function (rti_commonblock): '<S895>/S-Function1' incorporates:
26134 * Constant: '<S893>/Constant'
26135 * Constant: '<S893>/Constant1'
26136 */
26137 /* This comment workarounds a code generation problem */
26138
26139 /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */
26140 {
26141 static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
26142 0x00 };
26143
26144 Float32 delayTime = 0.0;
26145
26146 /* link this pointer to CAN_Msg for use in initialize_io_units() */
26147 CANTP1_PTR_M3_C2_XTD_0x18FFFAE4 = &(CAN_Msg[0]);
26148
26149 /* ... perform loop-back if required */
26150 if (L4_MABX_P.Constant1_Value_d > 0.5) {
26151 /* ... updating the used tx-clientbuffer */
26152 can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->module,
26153 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->queue );
26154
26155 /* ... Read status and timestamp info perform loop-back (previous message) */
26156 can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4,
26157 8, // datalen
26158 &(CAN_Msg[0]),
26159 CANTP1_RX_SPMSG_M3_C2_XTD);
26160
26161 /* Convert timestamp */
26162 if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->processed) {
26163 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp =
26164 rtk_dsts_time_to_simtime_convert
26165 (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp);
26166 }
26167 } else {
26168 /* ... Read status and timestamp info (previous message) */
26169 can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4);
26170
26171 /* Convert timestamp */
26172 if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->processed) {
26173 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp =
26174 rtk_dsts_time_to_simtime_convert
26175 (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp);
26176 }
26177 }
26178
26179 /* Messages with timestamp zero have been received in pause/stop state
26180 and must not be handled.
26181 */
26182 if (CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp > 0.0) {
26183 L4_MABX_B.SFunction1_o1_cb = (real_T)
26184 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->processed;
26185 L4_MABX_B.SFunction1_o2_nh = (real_T)
26186 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->timestamp;
26187 L4_MABX_B.SFunction1_o3_fe = (real_T)
26188 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->deltatime;
26189 L4_MABX_B.SFunction1_o4_eb = (real_T)
26190 CANTP1_TX_M3_C2_MCRCLT_XTD_0X18FFFAE4->delaytime;
26191 }
26192
26193 /* ... Encode Simulink signals of TX and RM blocks*/
26194 {
26195 rtican_Signal_t CAN_Sgn;
26196 UInt32 i;
26197
26198 /* Initialize the static message data to zero */
26199 for (i=0; i<8; i++ )
26200 CAN_Msg[i] = 0;
26201
26202 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
26203 /* Add or substract 0.5 in order to round to nearest integer */
26204 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[0] )
26205 + 0.5);
26206 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26207 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
26208
26209 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
26210 /* Add or substract 0.5 in order to round to nearest integer */
26211 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[1] )
26212 + 0.5);
26213 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26214 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
26215
26216 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
26217 /* Add or substract 0.5 in order to round to nearest integer */
26218 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[2] )
26219 + 0.5);
26220 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26221 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
26222
26223 /* ...... "byte4" (24|8, standard signal, unsigned int, little endian) */
26224 /* Add or substract 0.5 in order to round to nearest integer */
26225 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[3] )
26226 + 0.5);
26227 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26228 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
26229
26230 /* ...... "byte5" (32|8, standard signal, unsigned int, little endian) */
26231 /* Add or substract 0.5 in order to round to nearest integer */
26232 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[4] )
26233 + 0.5);
26234 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26235 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
26236
26237 /* ...... "byte6" (40|8, standard signal, unsigned int, little endian) */
26238 /* Add or substract 0.5 in order to round to nearest integer */
26239 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[5] )
26240 + 0.5);
26241 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26242 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
26243
26244 /* ...... "byte7" (48|8, standard signal, unsigned int, little endian) */
26245 /* Add or substract 0.5 in order to round to nearest integer */
26246 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[6] )
26247 + 0.5);
26248 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26249 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
26250
26251 /* ...... "byte8" (56|8, standard signal, unsigned int, little endian) */
26252 /* Add or substract 0.5 in order to round to nearest integer */
26253 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_m2[7] )
26254 + 0.5);
26255 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26256 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
26257 }
26258
26259 delayTime = (Float32) L4_MABX_P.Constant_Value_kn / (1700);
26260
26261 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
26262 can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFFAE4], 8,
26263 &(CAN_Msg[0]), delayTime);
26264 }
26265 }
26266
26267 /* End of Outputs for SubSystem: '<S893>/PropB_REAX_5_E4' */
26268
26269 /* DataTypeConversion: '<S912>/Data Type Conversion' */
26270 L4_MABX_B.DataTypeConversion_pi = L4_MABX_B.SID_k;
26271
26272 /* DataTypeConversion: '<S912>/Data Type Conversion1' */
26273 L4_MABX_B.DataTypeConversion1_k = L4_MABX_B.COGReference_k;
26274
26275 /* DataTypeConversion: '<S912>/Data Type Conversion2' */
26276 L4_MABX_B.DataTypeConversion2_m4 = L4_MABX_B.CourseOverGround_i;
26277
26278 /* DataTypeConversion: '<S912>/Data Type Conversion3' */
26279 L4_MABX_B.DataTypeConversion3_h = L4_MABX_B.SpeedOverGround_l;
26280
26281 /* DataTypeConversion: '<S882>/Data Type Conversion2' incorporates:
26282 * Constant: '<S853>/enableCOGSRapidUpdateTX'
26283 */
26284 L4_MABX_B.DataTypeConversion2_oy = L4_MABX_P.enableCOGSRapidUpdateTX_Value;
26285
26286 /* Outputs for Enabled SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' incorporates:
26287 * EnablePort: '<S913>/Enable'
26288 */
26289 if (L4_MABX_B.DataTypeConversion2_oy) {
26290 /* S-Function (rti_commonblock): '<S913>/S-Function1' incorporates:
26291 * Constant: '<S912>/Constant'
26292 * Constant: '<S912>/Constant1'
26293 */
26294 /* This comment workarounds a code generation problem */
26295
26296 /* dSPACE RTICAN TX Message Block: "Std_COGSOGRapidUpdate_01" Id:7 */
26297 {
26298 static UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
26299 0x00 };
26300
26301 Float32 delayTime = 0.0;
26302
26303 /* link this pointer to CAN_Msg for use in initialize_io_units() */
26304 CANTP1_PTR_M3_C2_STD_0x7 = &(CAN_Msg[0]);
26305
26306 /* ... perform loop-back if required */
26307 if (L4_MABX_P.Constant1_Value_jc > 0.5) {
26308 /* ... updating the used tx-clientbuffer */
26309 can_tp1_msg_update_all( CANTP1_TX_M3_C2_MCRCLT_STD_0X7->module,
26310 CANTP1_TX_M3_C2_MCRCLT_STD_0X7->queue );
26311
26312 /* ... Read status and timestamp info perform loop-back (previous message) */
26313 can_tp1_tx_msg_read_loopback(CANTP1_TX_M3_C2_MCRCLT_STD_0X7,
26314 8, // datalen
26315 &(CAN_Msg[0]),
26316 CANTP1_RX_SPMSG_M3_C2_STD);
26317
26318 /* Convert timestamp */
26319 if (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->processed) {
26320 CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp =
26321 rtk_dsts_time_to_simtime_convert
26322 (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp);
26323 }
26324 } else {
26325 /* ... Read status and timestamp info (previous message) */
26326 can_tp1_msg_read_from_dsmcr(CANTP1_TX_M3_C2_MCRCLT_STD_0X7);
26327
26328 /* Convert timestamp */
26329 if (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->processed) {
26330 CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp =
26331 rtk_dsts_time_to_simtime_convert
26332 (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp);
26333 }
26334 }
26335
26336 /* Messages with timestamp zero have been received in pause/stop state
26337 and must not be handled.
26338 */
26339 if (CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp > 0.0) {
26340 L4_MABX_B.SFunction1_o1_p = (real_T)
26341 CANTP1_TX_M3_C2_MCRCLT_STD_0X7->processed;
26342 L4_MABX_B.SFunction1_o2_brz = (real_T)
26343 CANTP1_TX_M3_C2_MCRCLT_STD_0X7->timestamp;
26344 L4_MABX_B.SFunction1_o3_hv = (real_T)
26345 CANTP1_TX_M3_C2_MCRCLT_STD_0X7->deltatime;
26346 L4_MABX_B.SFunction1_o4_m0 = (real_T)
26347 CANTP1_TX_M3_C2_MCRCLT_STD_0X7->delaytime;
26348 }
26349
26350 /* ... Encode Simulink signals of TX and RM blocks*/
26351 {
26352 rtican_Signal_t CAN_Sgn;
26353 UInt32 i;
26354
26355 /* Initialize the static message data to zero */
26356 for (i=0; i<8; i++ )
26357 CAN_Msg[i] = 0;
26358
26359 /* ...... "SID" (0|8, standard signal, unsigned int, little endian) */
26360 /* Add or substract 0.5 in order to round to nearest integer */
26361 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_pi ) +
26362 0.5);
26363 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26364 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
26365
26366 /* ...... "COGReference" (8|2, standard signal, unsigned int, little endian) */
26367 /* Add or substract 0.5 in order to round to nearest integer */
26368 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_k ) +
26369 0.5);
26370 CAN_Sgn.UnsignedSgn &= 0x00000003;
26371 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
26372
26373 /* ...... "CourseOverGround" (16|16, standard signal, unsigned int, little endian) */
26374 /* Add or substract 0.5 in order to round to nearest integer */
26375 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_m4 - ( 0
26376 ) ) / 0.0001 + 0.5);
26377 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
26378 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
26379 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte1;
26380
26381 /* ...... "SpeedOverGround" (32|16, standard signal, unsigned int, little endian) */
26382 /* Add or substract 0.5 in order to round to nearest integer */
26383 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion3_h - ( 0 )
26384 ) / 0.01 + 0.5);
26385 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
26386 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
26387 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte1;
26388 }
26389
26390 /* mask unused bits with '1' */
26391 CAN_Msg[1] |= 0xFC;
26392 CAN_Msg[6] |= 0xFF;
26393 CAN_Msg[7] |= 0xFF;
26394 delayTime = (Float32) L4_MABX_P.Constant_Value_c / (2000);
26395
26396 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
26397 can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X7], 8, &(CAN_Msg[0]),
26398 delayTime);
26399 }
26400 }
26401
26402 /* End of Outputs for SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' */
26403
26404 /* DataTypeConversion: '<S883>/Data Type Conversion2' incorporates:
26405 * Constant: '<S853>/enableEBC1_8B_TX'
26406 */
26407 L4_MABX_B.DataTypeConversion2_k2 = L4_MABX_P.enableEBC1_8B_TX_Value;
26408
26409 /* Outputs for Enabled SubSystem: '<S914>/EBC1_TX' incorporates:
26410 * EnablePort: '<S915>/Enable'
26411 */
26412 if (L4_MABX_B.DataTypeConversion2_k2) {
26413 /* S-Function (rti_commonblock): '<S915>/S-Function1' */
26414 /* This comment workarounds a code generation problem */
26415
26416 /* dSPACE RTICAN TX Message Block: "EBC1_TX" Id:418382219 */
26417 {
26418 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
26419
26420 Float32 delayTime = 0.0;
26421
26422 /* ... Read status and timestamp info (previous message) */
26423 can_tp1_msg_read(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]);
26424
26425 /* Convert timestamp */
26426 if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->processed) {
26427 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp =
26428 rtk_dsts_time_to_simtime_convert
26429 (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp);
26430 }
26431
26432 /* Messages with timestamp zero have been received in pause/stop state
26433 and must not be handled.
26434 */
26435 if (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp > 0.0) {
26436 L4_MABX_B.SFunction1_o1_jg = (real_T)
26437 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->processed;
26438 L4_MABX_B.SFunction1_o2_g = (real_T)
26439 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->timestamp;
26440 L4_MABX_B.SFunction1_o3_nw = (real_T)
26441 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->deltatime;
26442 L4_MABX_B.SFunction1_o4_jg = (real_T)
26443 can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B]->delaytime;
26444 }
26445
26446 /* ... Encode Simulink signals of TX and RM blocks*/
26447 {
26448 rtican_Signal_t CAN_Sgn;
26449
26450 /* ...... "ASREngCtrlActive" (0|2, standard signal, unsigned int, little endian) */
26451 /* Add or substract 0.5 in order to round to nearest integer */
26452 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASREngCtrlActive ) + 0.5);
26453 CAN_Sgn.UnsignedSgn &= 0x00000003;
26454 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
26455
26456 /* ...... "ASRBrakeCtrlActive" (2|2, standard signal, unsigned int, little endian) */
26457 /* Add or substract 0.5 in order to round to nearest integer */
26458 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASRBrakeCtrlActive ) + 0.5);
26459 CAN_Sgn.UnsignedSgn &= 0x00000003;
26460 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
26461 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
26462
26463 /* ...... "AntiLockBrakingActive" (4|2, standard signal, unsigned int, little endian) */
26464 /* Add or substract 0.5 in order to round to nearest integer */
26465 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AntiLockBrakingActive ) +
26466 0.5);
26467 CAN_Sgn.UnsignedSgn &= 0x00000003;
26468 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
26469 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
26470
26471 /* ...... "EBSBrakeSwitch" (6|2, standard signal, unsigned int, little endian) */
26472 /* Add or substract 0.5 in order to round to nearest integer */
26473 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EBSBrakeSwitch_c ) + 0.5);
26474 CAN_Sgn.UnsignedSgn &= 0x00000003;
26475 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
26476 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
26477
26478 /* ...... "BrakePedalPos" (8|8, standard signal, unsigned int, little endian) */
26479 /* Add or substract 0.5 in order to round to nearest integer */
26480 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BrakePedalPos - ( 0 ) ) /
26481 0.4 + 0.5);
26482 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26483 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
26484
26485 /* ...... "ABSOffroadSwitch" (16|2, standard signal, unsigned int, little endian) */
26486 /* Add or substract 0.5 in order to round to nearest integer */
26487 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ABSOffroadSwitch ) + 0.5);
26488 CAN_Sgn.UnsignedSgn &= 0x00000003;
26489 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
26490
26491 /* ...... "ASROffroadSwitch" (18|2, standard signal, unsigned int, little endian) */
26492 /* Add or substract 0.5 in order to round to nearest integer */
26493 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASROffroadSwitch ) + 0.5);
26494 CAN_Sgn.UnsignedSgn &= 0x00000003;
26495 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
26496 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
26497
26498 /* ...... "ASRHillHolderSwitch" (20|2, standard signal, unsigned int, little endian) */
26499 /* Add or substract 0.5 in order to round to nearest integer */
26500 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ASRHillHolderSwitch ) + 0.5);
26501 CAN_Sgn.UnsignedSgn &= 0x00000003;
26502 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
26503 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
26504
26505 /* ...... "TractionCtrlOverrideSwitch" (22|2, standard signal, unsigned int, little endian) */
26506 /* Add or substract 0.5 in order to round to nearest integer */
26507 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TractionCtrlOverrideSwitch )
26508 + 0.5);
26509 CAN_Sgn.UnsignedSgn &= 0x00000003;
26510 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
26511 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
26512
26513 /* ...... "AccelInterlockSwitch" (24|2, standard signal, unsigned int, little endian) */
26514 /* Add or substract 0.5 in order to round to nearest integer */
26515 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AccelInterlockSwitch ) + 0.5);
26516 CAN_Sgn.UnsignedSgn &= 0x00000003;
26517 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
26518
26519 /* ...... "EngDerateSwitch" (26|2, standard signal, unsigned int, little endian) */
26520 /* Add or substract 0.5 in order to round to nearest integer */
26521 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngDerateSwitch ) + 0.5);
26522 CAN_Sgn.UnsignedSgn &= 0x00000003;
26523 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
26524 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
26525
26526 /* ...... "EngAuxShutdownSwitch" (28|2, standard signal, unsigned int, little endian) */
26527 /* Add or substract 0.5 in order to round to nearest integer */
26528 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngAuxShutdownSwitch ) + 0.5);
26529 CAN_Sgn.UnsignedSgn &= 0x00000003;
26530 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
26531 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
26532
26533 /* ...... "RemoteAccelEnableSwitch" (30|2, standard signal, unsigned int, little endian) */
26534 /* Add or substract 0.5 in order to round to nearest integer */
26535 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.RemoteAccelEnableSwitch ) +
26536 0.5);
26537 CAN_Sgn.UnsignedSgn &= 0x00000003;
26538 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
26539 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
26540
26541 /* ...... "EngRetarderSelection" (32|8, standard signal, unsigned int, little endian) */
26542 /* Add or substract 0.5 in order to round to nearest integer */
26543 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EngRetarderSelection - ( 0 )
26544 ) / 0.4 + 0.5);
26545 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26546 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
26547
26548 /* ...... "ABSFullyOperational" (40|2, standard signal, unsigned int, little endian) */
26549 /* Add or substract 0.5 in order to round to nearest integer */
26550 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ABSFullyOperational ) + 0.5);
26551 CAN_Sgn.UnsignedSgn &= 0x00000003;
26552 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
26553
26554 /* ...... "EBSRedWarningSignal" (42|2, standard signal, unsigned int, little endian) */
26555 /* Add or substract 0.5 in order to round to nearest integer */
26556 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.EBSRedWarningSignal ) + 0.5);
26557 CAN_Sgn.UnsignedSgn &= 0x00000003;
26558 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
26559 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
26560
26561 /* ...... "ABS_EBSAmberWarningSignal" (44|2, standard signal, unsigned int, little endian) */
26562 /* Add or substract 0.5 in order to round to nearest integer */
26563 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ABS_EBSAmberWarningSignal )
26564 + 0.5);
26565 CAN_Sgn.UnsignedSgn &= 0x00000003;
26566 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
26567 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
26568
26569 /* ...... "ATC_ASRInformationSignal" (46|2, standard signal, unsigned int, little endian) */
26570 /* Add or substract 0.5 in order to round to nearest integer */
26571 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ATC_ASRInformationSignal ) +
26572 0.5);
26573 CAN_Sgn.UnsignedSgn &= 0x00000003;
26574 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
26575 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
26576
26577 /* ...... "SrcAddrssOfCtrllngDvcFrBrkCntrl" (48|8, standard signal, unsigned int, little endian) */
26578 /* Add or substract 0.5 in order to round to nearest integer */
26579 CAN_Sgn.UnsignedSgn = (UInt32)
26580 (( L4_MABX_B.SrcAddrssOfCtrllngDvcFrBrkCntrl ) + 0.5);
26581 CAN_Sgn.UnsignedSgn &= 0x000000FF;
26582 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
26583
26584 /* ...... "HaltBrakeSwitch" (58|2, standard signal, unsigned int, little endian) */
26585 /* Add or substract 0.5 in order to round to nearest integer */
26586 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.HaltBrakeSwitch ) + 0.5);
26587 CAN_Sgn.UnsignedSgn &= 0x00000003;
26588 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 2;
26589 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
26590
26591 /* ...... "TrailerABSStatus" (60|2, standard signal, unsigned int, little endian) */
26592 /* Add or substract 0.5 in order to round to nearest integer */
26593 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.TrailerABSStatus ) + 0.5);
26594 CAN_Sgn.UnsignedSgn &= 0x00000003;
26595 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 4;
26596 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
26597
26598 /* ...... "TrctrMntdTrilerABSWarningSignal" (62|2, standard signal, unsigned int, little endian) */
26599 /* Add or substract 0.5 in order to round to nearest integer */
26600 CAN_Sgn.UnsignedSgn = (UInt32)
26601 (( L4_MABX_B.TrctrMntdTrilerABSWarningSignal ) + 0.5);
26602 CAN_Sgn.UnsignedSgn &= 0x00000003;
26603 CAN_Sgn.UnsignedSgn = ((UInt32)CAN_Sgn.UnsignedSgn) << 6;
26604 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
26605 }
26606
26607 /* mask unused bits with '1' */
26608 CAN_Msg[7] |= 0x03;
26609
26610 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
26611 can_tp1_msg_send(can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B], 8,
26612 &(CAN_Msg[0]), delayTime);
26613 }
26614 }
26615
26616 /* End of Outputs for SubSystem: '<S914>/EBC1_TX' */
26617
26618 /* End of Outputs for SubSystem: '<S849>/CAN_TX_100ms' */
26619
26620 /* DiscretePulseGenerator: '<S1077>/Flash' */
26621 L4_MABX_B.Flash = (L4_MABX_DW.clockTickCounter_f < L4_MABX_P.Flash_Duty) &&
26622 (L4_MABX_DW.clockTickCounter_f >= 0) ? L4_MABX_P.Flash_Amp : 0.0;
26623 if (L4_MABX_DW.clockTickCounter_f >= L4_MABX_P.Flash_Period - 1.0) {
26624 L4_MABX_DW.clockTickCounter_f = 0;
26625 } else {
26626 L4_MABX_DW.clockTickCounter_f++;
26627 }
26628
26629 /* End of DiscretePulseGenerator: '<S1077>/Flash' */
26630 /* user code (Output function Trailer for TID3) */
26631
26632 /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */
26633 /* EventChannel: 0 */
26634 if (tid == 0) {
26635 DSXCP_service(0);
26636 }
26637
26638 /* If subsystem generates rate grouping Output functions,
26639 * when tid is used in Output function for one rate,
26640 * all Output functions include tid as a local variable.
26641 * As result, some Output functions may have unused tid.
26642 */
26643 UNUSED_PARAMETER(tid);
26644}
26645
26646/* Model update function for TID3 */
26647void L4_MABX_update3(void) /* Sample time: [0.1s, 0.0s] */
26648{
26649 /* Update for Atomic SubSystem: '<S849>/CAN_TX_100ms' */
26650
26651 /* Update for Enabled SubSystem: '<S886>/Rolling_15_counter' incorporates:
26652 * EnablePort: '<S928>/Enable'
26653 */
26654 if (L4_MABX_B.TmpRTBAtHiddenBuf_InsertedFor_R) {
26655 /* Update for UnitDelay: '<S928>/Unit_Delay' */
26656 L4_MABX_DW.Unit_Delay_DSTATE = L4_MABX_B.FixPtSwitch;
26657 }
26658
26659 /* End of Update for SubSystem: '<S886>/Rolling_15_counter' */
26660
26661 /* End of Update for SubSystem: '<S849>/CAN_TX_100ms' */
26662
26663 /* Update for RateTransition: '<S1077>/TmpRTBAtFlashOutport1' */
26664 L4_MABX_DW.TmpRTBAtFlashOutport1_Buffer0 = L4_MABX_B.Flash;
26665}
26666
26667/* Model output function for TID4 */
26668void L4_MABX_output4(void) /* Sample time: [0.25s, 0.0s] */
26669{
26670 int_T tid = 4;
26671
26672 /* user code (Output function Trailer for TID4) */
26673
26674 /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */
26675 /* EventChannel: 0 */
26676 if (tid == 0) {
26677 DSXCP_service(0);
26678 }
26679
26680 /* If subsystem generates rate grouping Output functions,
26681 * when tid is used in Output function for one rate,
26682 * all Output functions include tid as a local variable.
26683 * As result, some Output functions may have unused tid.
26684 */
26685 UNUSED_PARAMETER(tid);
26686}
26687
26688/* Model update function for TID4 */
26689void L4_MABX_update4(void) /* Sample time: [0.25s, 0.0s] */
26690{
26691 /* (no update code required) */
26692}
26693
26694/* Model output function for TID5 */
26695void L4_MABX_output5(void) /* Sample time: [0.5s, 0.0s] */
26696{
26697 int_T tid = 5;
26698 boolean_T zcEvent;
26699 uint32_T q0;
26700 uint32_T qY;
26701
26702 /* S-Function (rti_commonblock): '<S28>/S-Function1' */
26703 /* This comment workarounds a code generation problem */
26704
26705 /* dSPACE RTICAN Status block */
26706 /* ... read status variables of the CAN microcontroller */
26707 {
26708 UInt32 loop_counter, memory, j;
26709 for (j=0;j<=9;j++) {
26710 rtican_type1_tq_error[0][6] = can_tp1_service_read
26711 (can_type1_service_M1_C1[j]);
26712 loop_counter = 0;
26713 while ((rtican_type1_tq_error[0][6] = can_tp1_service_request
26714 (can_type1_service_M1_C1[j]))== DSMCOM_BUFFER_OVERFLOW) {
26715 loop_counter++;
26716 if (loop_counter > MAX_LOOP) {
26717 memory = rtican_type1_error_level;
26718 rtican_type1_error_level = 1;
26719 rtican_type1_tq_err_sig(0, 6);
26720 rtican_type1_error_level = memory;
26721 break;
26722 }
26723 }
26724
26725 if (j==CANTP1_M1_C1_RXLost) {
26726 rtican_type1_tq_error[0][6] = can_tp1_service_read
26727 (can_type1_service_M1_C1[CANTP1_M1_C1_DataLost]);
26728 loop_counter = 0;
26729 while ((rtican_type1_tq_error[0][6] = can_tp1_service_request
26730 (can_type1_service_M1_C1[CANTP1_M1_C1_DataLost]))==
26731 DSMCOM_BUFFER_OVERFLOW) {
26732 loop_counter++;
26733 if (loop_counter > MAX_LOOP) {
26734 memory = rtican_type1_error_level;
26735 rtican_type1_error_level = 1;
26736 rtican_type1_tq_err_sig(0, 6);
26737 rtican_type1_error_level = memory;
26738 break;
26739 }
26740 }
26741 }
26742 }
26743
26744 L4_MABX_B.SFunction1_o1_kx = (UInt32)
26745 can_type1_service_M1_C1[CANTP1_M1_C1_Status]->data0;
26746 DIAG_CAN1_Count_Stuff_Errors = (UInt32)
26747 can_type1_service_M1_C1[CANTP1_M1_C1_StuffErrors]->data0;
26748 DIAG_CAN1_Count_Format_Errors = (UInt32)
26749 can_type1_service_M1_C1[CANTP1_M1_C1_FormatErrors]->data0;
26750 DIAG_CAN1_Count_Ack_Errors = (UInt32)
26751 can_type1_service_M1_C1[CANTP1_M1_C1_AckErrors]->data0;
26752 DIAG_CAN1_Count_Bit0_Errors = (UInt32)
26753 can_type1_service_M1_C1[CANTP1_M1_C1_Bit0Errors]->data0;
26754 DIAG_CAN1_Count_Bit1_Errors = (UInt32)
26755 can_type1_service_M1_C1[CANTP1_M1_C1_Bit1Errors]->data0;
26756 DIAG_CAN1_Count_CRC_Errors = (UInt32)
26757 can_type1_service_M1_C1[CANTP1_M1_C1_CRCErrors]->data0;
26758 DIAG_CAN1_Count_RX_Lost = (UInt32)
26759 (can_type1_service_M1_C1[CANTP1_M1_C1_RXLost]->data0 +
26760 can_type1_service_M1_C1[CANTP1_M1_C1_DataLost]->data0);
26761 DIAG_CAN1_Count_RX_OK = (UInt32) can_type1_service_M1_C1[CANTP1_M1_C1_RXOK
26762 ]->data0;
26763 DIAG_CAN1_Count_TX_OK = (UInt32) can_type1_service_M1_C1[CANTP1_M1_C1_TXOK
26764 ]->data0;
26765 }
26766
26767 /* DataTypeConversion: '<S1>/Data Type Conversion' */
26768 DIAG_CAN1_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI
26769 ((int32_T)L4_MABX_B.SFunction1_o1_kx);
26770
26771 /* RelationalOperator: '<S22>/Operator' incorporates:
26772 * Constant: '<S1>/Constant'
26773 */
26774 L4_MABX_B.Operator_eu = (L4_MABX_P.Constant_Value_cq == DIAG_CAN1_Status);
26775
26776 /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_1' incorporates:
26777 * EnablePort: '<S11>/Enable'
26778 */
26779 if (L4_MABX_B.Operator_eu) {
26780 /* Reshape: '<S30>/Reshape' incorporates:
26781 * Constant: '<S30>/Constant'
26782 */
26783 L4_MABX_B.Reshape_g[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_l[0];
26784 L4_MABX_B.Reshape_g[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_l[1];
26785
26786 /* UnitDelay: '<S30>/Unit_Delay' */
26787 L4_MABX_B.Unit_Delay_h4 = L4_MABX_DW.Unit_Delay_DSTATE_f1;
26788
26789 /* UnitDelay: '<S31>/Unit Delay' */
26790 L4_MABX_B.UnitDelay_f4 = L4_MABX_DW.UnitDelay_DSTATE_j1;
26791
26792 /* Switch: '<S34>/Switch1' incorporates:
26793 * Constant: '<S31>/E'
26794 * Constant: '<S31>/IV'
26795 * Switch: '<S33>/Switch1'
26796 */
26797 if (L4_MABX_B.Unit_Delay_h4) {
26798 L4_MABX_B.Switch1_o = L4_MABX_P.IV_Value_m;
26799 } else {
26800 if (L4_MABX_P.E_Value) {
26801 /* Sum: '<S31>/Subtract' incorporates:
26802 * Constant: '<S31>/Constant'
26803 * Switch: '<S33>/Switch1'
26804 */
26805 q0 = L4_MABX_P.Constant_Value_j;
26806 qY = q0 + L4_MABX_B.UnitDelay_f4;
26807 if (qY < q0) {
26808 qY = MAX_uint32_T;
26809 }
26810
26811 L4_MABX_B.Subtract_ot = qY;
26812
26813 /* End of Sum: '<S31>/Subtract' */
26814
26815 /* Switch: '<S33>/Switch1' */
26816 L4_MABX_B.Switch1_az = L4_MABX_B.Subtract_ot;
26817 } else {
26818 /* Switch: '<S33>/Switch1' */
26819 L4_MABX_B.Switch1_az = L4_MABX_B.UnitDelay_f4;
26820 }
26821
26822 L4_MABX_B.Switch1_o = L4_MABX_B.Switch1_az;
26823 }
26824
26825 /* End of Switch: '<S34>/Switch1' */
26826
26827 /* Selector: '<S30>/Selector' */
26828 L4_MABX_B.Selector_d = L4_MABX_B.Reshape_g[(int32_T)L4_MABX_B.Switch1_o - 1];
26829
26830 /* Outputs for Triggered SubSystem: '<S11>/CAN_TYPE1_BOR_M1_C1' incorporates:
26831 * TriggerPort: '<S29>/Trigger'
26832 */
26833 zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE == POS_ZCSIG) !=
26834 (int32_T)L4_MABX_B.Selector_d) &&
26835 (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE !=
26836 UNINITIALIZED_ZCSIG));
26837 if (zcEvent) {
26838 /* S-Function (rti_commonblock): '<S29>/S-Function1' */
26839 /* This comment workarounds a code generation problem */
26840
26841 /* dSPACE RTICAN Bus Off Recovery block */
26842 /* ... Perform software-reset of the CAN microcontroller */
26843 {
26844 UInt32 loop_counter, memory;
26845 loop_counter = 0;
26846 while ((rtican_type1_tq_error[0][0] = can_tp1_channel_BOff_return
26847 (can_type1_channel_M1_C1)) == DSMCOM_BUFFER_OVERFLOW) {
26848 loop_counter++;
26849 if (loop_counter > MAX_LOOP) {
26850 memory = rtican_type1_error_level;
26851 rtican_type1_error_level = 1;
26852 rtican_type1_tq_err_sig(0, 0);
26853 rtican_type1_error_level = memory;
26854 break;
26855 }
26856 }
26857
26858 while ((rtican_type1_tq_error[0][0] = can_tp1_channel_all_wakeup
26859 (can_type1_channel_M1_C1)) == DSMCOM_BUFFER_OVERFLOW) {
26860 loop_counter++;
26861 if (loop_counter > MAX_LOOP) {
26862 memory = rtican_type1_error_level;
26863 rtican_type1_error_level = 1;
26864 rtican_type1_tq_err_sig(0, 0);
26865 rtican_type1_error_level = memory;
26866 break;
26867 }
26868 }
26869 }
26870 }
26871
26872 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE = L4_MABX_B.Selector_d;
26873
26874 /* End of Outputs for SubSystem: '<S11>/CAN_TYPE1_BOR_M1_C1' */
26875
26876 /* RelationalOperator: '<S32>/Operator' */
26877 L4_MABX_B.Operator_f5 = (L4_MABX_B.Switch1_o == L4_MABX_ConstB.Width_p);
26878 }
26879
26880 /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */
26881
26882 /* S-Function (rti_commonblock): '<S20>/S-Function1' */
26883 /* This comment workarounds a code generation problem */
26884
26885 /* dSPACE RTICAN Status block */
26886 /* ... read status variables of the CAN microcontroller */
26887 {
26888 UInt32 loop_counter, memory, j;
26889 for (j=0;j<=9;j++) {
26890 rtican_type1_tq_error[2][6] = can_tp1_service_read
26891 (can_type1_service_M3_C1[j]);
26892 loop_counter = 0;
26893 while ((rtican_type1_tq_error[2][6] = can_tp1_service_request
26894 (can_type1_service_M3_C1[j]))== DSMCOM_BUFFER_OVERFLOW) {
26895 loop_counter++;
26896 if (loop_counter > MAX_LOOP) {
26897 memory = rtican_type1_error_level;
26898 rtican_type1_error_level = 1;
26899 rtican_type1_tq_err_sig(2, 6);
26900 rtican_type1_error_level = memory;
26901 break;
26902 }
26903 }
26904
26905 if (j==CANTP1_M3_C1_RXLost) {
26906 rtican_type1_tq_error[2][6] = can_tp1_service_read
26907 (can_type1_service_M3_C1[CANTP1_M3_C1_DataLost]);
26908 loop_counter = 0;
26909 while ((rtican_type1_tq_error[2][6] = can_tp1_service_request
26910 (can_type1_service_M3_C1[CANTP1_M3_C1_DataLost]))==
26911 DSMCOM_BUFFER_OVERFLOW) {
26912 loop_counter++;
26913 if (loop_counter > MAX_LOOP) {
26914 memory = rtican_type1_error_level;
26915 rtican_type1_error_level = 1;
26916 rtican_type1_tq_err_sig(2, 6);
26917 rtican_type1_error_level = memory;
26918 break;
26919 }
26920 }
26921 }
26922 }
26923
26924 L4_MABX_B.SFunction1_o1_g3 = (UInt32)
26925 can_type1_service_M3_C1[CANTP1_M3_C1_Status]->data0;
26926 DIAG_CAN5_Count_Stuff_Errors = (UInt32)
26927 can_type1_service_M3_C1[CANTP1_M3_C1_StuffErrors]->data0;
26928 DIAG_CAN5_Count_Format_Errors = (UInt32)
26929 can_type1_service_M3_C1[CANTP1_M3_C1_FormatErrors]->data0;
26930 DIAG_CAN5_Count_Ack_Errors = (UInt32)
26931 can_type1_service_M3_C1[CANTP1_M3_C1_AckErrors]->data0;
26932 DIAG_CAN5_Count_Bit0_Errors = (UInt32)
26933 can_type1_service_M3_C1[CANTP1_M3_C1_Bit0Errors]->data0;
26934 DIAG_CAN5_Count_Bit1_Errors = (UInt32)
26935 can_type1_service_M3_C1[CANTP1_M3_C1_Bit1Errors]->data0;
26936 DIAG_CAN5_Count_CRC_Errors = (UInt32)
26937 can_type1_service_M3_C1[CANTP1_M3_C1_CRCErrors]->data0;
26938 DIAG_CAN5_Count_RX_Lost = (UInt32)
26939 (can_type1_service_M3_C1[CANTP1_M3_C1_RXLost]->data0 +
26940 can_type1_service_M3_C1[CANTP1_M3_C1_DataLost]->data0);
26941 DIAG_CAN5_Count_RX_OK = (UInt32) can_type1_service_M3_C1[CANTP1_M3_C1_RXOK
26942 ]->data0;
26943 DIAG_CAN5_Count_TX_OK = (UInt32) can_type1_service_M3_C1[CANTP1_M3_C1_TXOK
26944 ]->data0;
26945 }
26946
26947 /* DataTypeConversion: '<S1>/Data Type Conversion5' */
26948 DIAG_CAN5_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI
26949 ((int32_T)L4_MABX_B.SFunction1_o1_g3);
26950
26951 /* RelationalOperator: '<S26>/Operator' incorporates:
26952 * Constant: '<S1>/Constant4'
26953 */
26954 L4_MABX_B.Operator_msz = (L4_MABX_P.Constant4_Value_np == DIAG_CAN5_Status);
26955
26956 /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_5' incorporates:
26957 * EnablePort: '<S15>/Enable'
26958 */
26959 if (L4_MABX_B.Operator_msz) {
26960 /* Reshape: '<S54>/Reshape' incorporates:
26961 * Constant: '<S54>/Constant'
26962 */
26963 L4_MABX_B.Reshape_a[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_j[0];
26964 L4_MABX_B.Reshape_a[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_j[1];
26965
26966 /* UnitDelay: '<S54>/Unit_Delay' */
26967 L4_MABX_B.Unit_Delay_p1 = L4_MABX_DW.Unit_Delay_DSTATE_i5;
26968
26969 /* UnitDelay: '<S55>/Unit Delay' */
26970 L4_MABX_B.UnitDelay_j5 = L4_MABX_DW.UnitDelay_DSTATE_p;
26971
26972 /* Switch: '<S58>/Switch1' incorporates:
26973 * Constant: '<S55>/E'
26974 * Constant: '<S55>/IV'
26975 * Switch: '<S57>/Switch1'
26976 */
26977 if (L4_MABX_B.Unit_Delay_p1) {
26978 L4_MABX_B.Switch1_k = L4_MABX_P.IV_Value_h;
26979 } else {
26980 if (L4_MABX_P.E_Value_db) {
26981 /* Sum: '<S55>/Subtract' incorporates:
26982 * Constant: '<S55>/Constant'
26983 * Switch: '<S57>/Switch1'
26984 */
26985 q0 = L4_MABX_P.Constant_Value_jg;
26986 qY = q0 + L4_MABX_B.UnitDelay_j5;
26987 if (qY < q0) {
26988 qY = MAX_uint32_T;
26989 }
26990
26991 L4_MABX_B.Subtract_md = qY;
26992
26993 /* End of Sum: '<S55>/Subtract' */
26994
26995 /* Switch: '<S57>/Switch1' */
26996 L4_MABX_B.Switch1_l = L4_MABX_B.Subtract_md;
26997 } else {
26998 /* Switch: '<S57>/Switch1' */
26999 L4_MABX_B.Switch1_l = L4_MABX_B.UnitDelay_j5;
27000 }
27001
27002 L4_MABX_B.Switch1_k = L4_MABX_B.Switch1_l;
27003 }
27004
27005 /* End of Switch: '<S58>/Switch1' */
27006
27007 /* Selector: '<S54>/Selector' */
27008 L4_MABX_B.Selector_p = L4_MABX_B.Reshape_a[(int32_T)L4_MABX_B.Switch1_k - 1];
27009
27010 /* Outputs for Triggered SubSystem: '<S15>/CAN_TYPE1_BOR_M3_C1' incorporates:
27011 * TriggerPort: '<S53>/Trigger'
27012 */
27013 zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE == POS_ZCSIG) !=
27014 (int32_T)L4_MABX_B.Selector_p) &&
27015 (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE !=
27016 UNINITIALIZED_ZCSIG));
27017 if (zcEvent) {
27018 /* S-Function (rti_commonblock): '<S53>/S-Function1' */
27019 /* This comment workarounds a code generation problem */
27020
27021 /* dSPACE RTICAN Bus Off Recovery block */
27022 /* ... Perform software-reset of the CAN microcontroller */
27023 {
27024 UInt32 loop_counter, memory;
27025 loop_counter = 0;
27026 while ((rtican_type1_tq_error[2][0] = can_tp1_channel_BOff_return
27027 (can_type1_channel_M3_C1)) == DSMCOM_BUFFER_OVERFLOW) {
27028 loop_counter++;
27029 if (loop_counter > MAX_LOOP) {
27030 memory = rtican_type1_error_level;
27031 rtican_type1_error_level = 1;
27032 rtican_type1_tq_err_sig(2, 0);
27033 rtican_type1_error_level = memory;
27034 break;
27035 }
27036 }
27037
27038 while ((rtican_type1_tq_error[2][0] = can_tp1_channel_all_wakeup
27039 (can_type1_channel_M3_C1)) == DSMCOM_BUFFER_OVERFLOW) {
27040 loop_counter++;
27041 if (loop_counter > MAX_LOOP) {
27042 memory = rtican_type1_error_level;
27043 rtican_type1_error_level = 1;
27044 rtican_type1_tq_err_sig(2, 0);
27045 rtican_type1_error_level = memory;
27046 break;
27047 }
27048 }
27049 }
27050 }
27051
27052 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE = L4_MABX_B.Selector_p;
27053
27054 /* End of Outputs for SubSystem: '<S15>/CAN_TYPE1_BOR_M3_C1' */
27055
27056 /* RelationalOperator: '<S56>/Operator' */
27057 L4_MABX_B.Operator_ho = (L4_MABX_B.Switch1_k == L4_MABX_ConstB.Width_a);
27058 }
27059
27060 /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */
27061
27062 /* S-Function (rti_commonblock): '<S21>/S-Function1' */
27063 /* This comment workarounds a code generation problem */
27064
27065 /* dSPACE RTICAN Status block */
27066 /* ... read status variables of the CAN microcontroller */
27067 {
27068 UInt32 loop_counter, memory, j;
27069 for (j=0;j<=9;j++) {
27070 rtican_type1_tq_error[2][6] = can_tp1_service_read
27071 (can_type1_service_M3_C2[j]);
27072 loop_counter = 0;
27073 while ((rtican_type1_tq_error[2][6] = can_tp1_service_request
27074 (can_type1_service_M3_C2[j]))== DSMCOM_BUFFER_OVERFLOW) {
27075 loop_counter++;
27076 if (loop_counter > MAX_LOOP) {
27077 memory = rtican_type1_error_level;
27078 rtican_type1_error_level = 1;
27079 rtican_type1_tq_err_sig(2, 6);
27080 rtican_type1_error_level = memory;
27081 break;
27082 }
27083 }
27084
27085 if (j==CANTP1_M3_C2_RXLost) {
27086 rtican_type1_tq_error[2][6] = can_tp1_service_read
27087 (can_type1_service_M3_C2[CANTP1_M3_C2_DataLost]);
27088 loop_counter = 0;
27089 while ((rtican_type1_tq_error[2][6] = can_tp1_service_request
27090 (can_type1_service_M3_C2[CANTP1_M3_C2_DataLost]))==
27091 DSMCOM_BUFFER_OVERFLOW) {
27092 loop_counter++;
27093 if (loop_counter > MAX_LOOP) {
27094 memory = rtican_type1_error_level;
27095 rtican_type1_error_level = 1;
27096 rtican_type1_tq_err_sig(2, 6);
27097 rtican_type1_error_level = memory;
27098 break;
27099 }
27100 }
27101 }
27102 }
27103
27104 L4_MABX_B.SFunction1_o1_ar = (UInt32)
27105 can_type1_service_M3_C2[CANTP1_M3_C2_Status]->data0;
27106 DIAG_CAN6_Count_Stuff_Errors = (UInt32)
27107 can_type1_service_M3_C2[CANTP1_M3_C2_StuffErrors]->data0;
27108 DIAG_CAN6_Count_Format_Errors = (UInt32)
27109 can_type1_service_M3_C2[CANTP1_M3_C2_FormatErrors]->data0;
27110 DIAG_CAN6_Count_Ack_Errors = (UInt32)
27111 can_type1_service_M3_C2[CANTP1_M3_C2_AckErrors]->data0;
27112 DIAG_CAN6_Count_Bit0_Errors = (UInt32)
27113 can_type1_service_M3_C2[CANTP1_M3_C2_Bit0Errors]->data0;
27114 DIAG_CAN6_Count_Bit1_Errors = (UInt32)
27115 can_type1_service_M3_C2[CANTP1_M3_C2_Bit1Errors]->data0;
27116 DIAG_CAN6_Count_CRC_Errors = (UInt32)
27117 can_type1_service_M3_C2[CANTP1_M3_C2_CRCErrors]->data0;
27118 DIAG_CAN6_Count_RX_Lost = (UInt32)
27119 (can_type1_service_M3_C2[CANTP1_M3_C2_RXLost]->data0 +
27120 can_type1_service_M3_C2[CANTP1_M3_C2_DataLost]->data0);
27121 DIAG_CAN6_Count_RX_OK = (UInt32) can_type1_service_M3_C2[CANTP1_M3_C2_RXOK
27122 ]->data0;
27123 DIAG_CAN6_Count_TX_OK = (UInt32) can_type1_service_M3_C2[CANTP1_M3_C2_TXOK
27124 ]->data0;
27125 }
27126
27127 /* DataTypeConversion: '<S1>/Data Type Conversion4' */
27128 DIAG_CAN6_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI
27129 ((int32_T)L4_MABX_B.SFunction1_o1_ar);
27130
27131 /* RelationalOperator: '<S27>/Operator' incorporates:
27132 * Constant: '<S1>/Constant5'
27133 */
27134 L4_MABX_B.Operator_fv = (L4_MABX_P.Constant5_Value_m == DIAG_CAN6_Status);
27135
27136 /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_6' incorporates:
27137 * EnablePort: '<S16>/Enable'
27138 */
27139 if (L4_MABX_B.Operator_fv) {
27140 /* Reshape: '<S60>/Reshape' incorporates:
27141 * Constant: '<S60>/Constant'
27142 */
27143 L4_MABX_B.Reshape_j[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_e[0];
27144 L4_MABX_B.Reshape_j[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_e[1];
27145
27146 /* UnitDelay: '<S60>/Unit_Delay' */
27147 L4_MABX_B.Unit_Delay_mw = L4_MABX_DW.Unit_Delay_DSTATE_l5;
27148
27149 /* UnitDelay: '<S61>/Unit Delay' */
27150 L4_MABX_B.UnitDelay_a = L4_MABX_DW.UnitDelay_DSTATE_dr;
27151
27152 /* Switch: '<S64>/Switch1' incorporates:
27153 * Constant: '<S61>/E'
27154 * Constant: '<S61>/IV'
27155 * Switch: '<S63>/Switch1'
27156 */
27157 if (L4_MABX_B.Unit_Delay_mw) {
27158 L4_MABX_B.Switch1_ht = L4_MABX_P.IV_Value_ey;
27159 } else {
27160 if (L4_MABX_P.E_Value_c) {
27161 /* Sum: '<S61>/Subtract' incorporates:
27162 * Constant: '<S61>/Constant'
27163 * Switch: '<S63>/Switch1'
27164 */
27165 q0 = L4_MABX_P.Constant_Value_iu;
27166 qY = q0 + L4_MABX_B.UnitDelay_a;
27167 if (qY < q0) {
27168 qY = MAX_uint32_T;
27169 }
27170
27171 L4_MABX_B.Subtract_fc = qY;
27172
27173 /* End of Sum: '<S61>/Subtract' */
27174
27175 /* Switch: '<S63>/Switch1' */
27176 L4_MABX_B.Switch1_b = L4_MABX_B.Subtract_fc;
27177 } else {
27178 /* Switch: '<S63>/Switch1' */
27179 L4_MABX_B.Switch1_b = L4_MABX_B.UnitDelay_a;
27180 }
27181
27182 L4_MABX_B.Switch1_ht = L4_MABX_B.Switch1_b;
27183 }
27184
27185 /* End of Switch: '<S64>/Switch1' */
27186
27187 /* Selector: '<S60>/Selector' */
27188 L4_MABX_B.Selector_h = L4_MABX_B.Reshape_j[(int32_T)L4_MABX_B.Switch1_ht - 1];
27189
27190 /* Outputs for Triggered SubSystem: '<S16>/CAN_TYPE1_BOR_M3_C2' incorporates:
27191 * TriggerPort: '<S59>/Trigger'
27192 */
27193 zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE == POS_ZCSIG) !=
27194 (int32_T)L4_MABX_B.Selector_h) &&
27195 (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE !=
27196 UNINITIALIZED_ZCSIG));
27197 if (zcEvent) {
27198 /* S-Function (rti_commonblock): '<S59>/S-Function1' */
27199 /* This comment workarounds a code generation problem */
27200
27201 /* dSPACE RTICAN Bus Off Recovery block */
27202 /* ... Perform software-reset of the CAN microcontroller */
27203 {
27204 UInt32 loop_counter, memory;
27205 loop_counter = 0;
27206 while ((rtican_type1_tq_error[2][0] = can_tp1_channel_BOff_return
27207 (can_type1_channel_M3_C2)) == DSMCOM_BUFFER_OVERFLOW) {
27208 loop_counter++;
27209 if (loop_counter > MAX_LOOP) {
27210 memory = rtican_type1_error_level;
27211 rtican_type1_error_level = 1;
27212 rtican_type1_tq_err_sig(2, 0);
27213 rtican_type1_error_level = memory;
27214 break;
27215 }
27216 }
27217
27218 while ((rtican_type1_tq_error[2][0] = can_tp1_channel_all_wakeup
27219 (can_type1_channel_M3_C2)) == DSMCOM_BUFFER_OVERFLOW) {
27220 loop_counter++;
27221 if (loop_counter > MAX_LOOP) {
27222 memory = rtican_type1_error_level;
27223 rtican_type1_error_level = 1;
27224 rtican_type1_tq_err_sig(2, 0);
27225 rtican_type1_error_level = memory;
27226 break;
27227 }
27228 }
27229 }
27230 }
27231
27232 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE = L4_MABX_B.Selector_h;
27233
27234 /* End of Outputs for SubSystem: '<S16>/CAN_TYPE1_BOR_M3_C2' */
27235
27236 /* RelationalOperator: '<S62>/Operator' */
27237 L4_MABX_B.Operator_bg = (L4_MABX_B.Switch1_ht == L4_MABX_ConstB.Width);
27238 }
27239
27240 /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */
27241
27242 /* S-Function (rti_commonblock): '<S18>/S-Function1' */
27243 /* This comment workarounds a code generation problem */
27244
27245 /* dSPACE RTICAN Status block */
27246 /* ... read status variables of the CAN microcontroller */
27247 {
27248 UInt32 loop_counter, memory, j;
27249 for (j=0;j<=9;j++) {
27250 rtican_type1_tq_error[1][6] = can_tp1_service_read
27251 (can_type1_service_M2_C1[j]);
27252 loop_counter = 0;
27253 while ((rtican_type1_tq_error[1][6] = can_tp1_service_request
27254 (can_type1_service_M2_C1[j]))== DSMCOM_BUFFER_OVERFLOW) {
27255 loop_counter++;
27256 if (loop_counter > MAX_LOOP) {
27257 memory = rtican_type1_error_level;
27258 rtican_type1_error_level = 1;
27259 rtican_type1_tq_err_sig(1, 6);
27260 rtican_type1_error_level = memory;
27261 break;
27262 }
27263 }
27264
27265 if (j==CANTP1_M2_C1_RXLost) {
27266 rtican_type1_tq_error[1][6] = can_tp1_service_read
27267 (can_type1_service_M2_C1[CANTP1_M2_C1_DataLost]);
27268 loop_counter = 0;
27269 while ((rtican_type1_tq_error[1][6] = can_tp1_service_request
27270 (can_type1_service_M2_C1[CANTP1_M2_C1_DataLost]))==
27271 DSMCOM_BUFFER_OVERFLOW) {
27272 loop_counter++;
27273 if (loop_counter > MAX_LOOP) {
27274 memory = rtican_type1_error_level;
27275 rtican_type1_error_level = 1;
27276 rtican_type1_tq_err_sig(1, 6);
27277 rtican_type1_error_level = memory;
27278 break;
27279 }
27280 }
27281 }
27282 }
27283
27284 L4_MABX_B.SFunction1_o1_h4v = (UInt32)
27285 can_type1_service_M2_C1[CANTP1_M2_C1_Status]->data0;
27286 DIAG_CAN3_Count_Stuff_Errors = (UInt32)
27287 can_type1_service_M2_C1[CANTP1_M2_C1_StuffErrors]->data0;
27288 DIAG_CAN3_Count_Format_Errors = (UInt32)
27289 can_type1_service_M2_C1[CANTP1_M2_C1_FormatErrors]->data0;
27290 DIAG_CAN3_Count_Ack_Errors = (UInt32)
27291 can_type1_service_M2_C1[CANTP1_M2_C1_AckErrors]->data0;
27292 DIAG_CAN3_Count_Bit0_Errors = (UInt32)
27293 can_type1_service_M2_C1[CANTP1_M2_C1_Bit0Errors]->data0;
27294 DIAG_CAN3_Count_Bit1_Errors = (UInt32)
27295 can_type1_service_M2_C1[CANTP1_M2_C1_Bit1Errors]->data0;
27296 DIAG_CAN3_Count_CRC_Errors = (UInt32)
27297 can_type1_service_M2_C1[CANTP1_M2_C1_CRCErrors]->data0;
27298 DIAG_CAN3_Count_RX_Lost = (UInt32)
27299 (can_type1_service_M2_C1[CANTP1_M2_C1_RXLost]->data0 +
27300 can_type1_service_M2_C1[CANTP1_M2_C1_DataLost]->data0);
27301 DIAG_CAN3_Count_RX_OK = (UInt32) can_type1_service_M2_C1[CANTP1_M2_C1_RXOK
27302 ]->data0;
27303 DIAG_CAN3_Count_TX_OK = (UInt32) can_type1_service_M2_C1[CANTP1_M2_C1_TXOK
27304 ]->data0;
27305 }
27306
27307 /* DataTypeConversion: '<S1>/Data Type Conversion3' */
27308 DIAG_CAN3_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI
27309 ((int32_T)L4_MABX_B.SFunction1_o1_h4v);
27310
27311 /* RelationalOperator: '<S24>/Operator' incorporates:
27312 * Constant: '<S1>/Constant1'
27313 */
27314 L4_MABX_B.Operator_bs = (L4_MABX_P.Constant1_Value_c0 == DIAG_CAN3_Status);
27315
27316 /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_3' incorporates:
27317 * EnablePort: '<S13>/Enable'
27318 */
27319 if (L4_MABX_B.Operator_bs) {
27320 /* Reshape: '<S42>/Reshape' incorporates:
27321 * Constant: '<S42>/Constant'
27322 */
27323 L4_MABX_B.Reshape_i[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_o[0];
27324 L4_MABX_B.Reshape_i[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_o[1];
27325
27326 /* UnitDelay: '<S42>/Unit_Delay' */
27327 L4_MABX_B.Unit_Delay_m0 = L4_MABX_DW.Unit_Delay_DSTATE_h41;
27328
27329 /* UnitDelay: '<S43>/Unit Delay' */
27330 L4_MABX_B.UnitDelay_d = L4_MABX_DW.UnitDelay_DSTATE_dr4;
27331
27332 /* Switch: '<S46>/Switch1' incorporates:
27333 * Constant: '<S43>/E'
27334 * Constant: '<S43>/IV'
27335 * Switch: '<S45>/Switch1'
27336 */
27337 if (L4_MABX_B.Unit_Delay_m0) {
27338 L4_MABX_B.Switch1_k4 = L4_MABX_P.IV_Value_b;
27339 } else {
27340 if (L4_MABX_P.E_Value_d) {
27341 /* Sum: '<S43>/Subtract' incorporates:
27342 * Constant: '<S43>/Constant'
27343 * Switch: '<S45>/Switch1'
27344 */
27345 q0 = L4_MABX_P.Constant_Value_h3;
27346 qY = q0 + L4_MABX_B.UnitDelay_d;
27347 if (qY < q0) {
27348 qY = MAX_uint32_T;
27349 }
27350
27351 L4_MABX_B.Subtract_h1 = qY;
27352
27353 /* End of Sum: '<S43>/Subtract' */
27354
27355 /* Switch: '<S45>/Switch1' */
27356 L4_MABX_B.Switch1_fr = L4_MABX_B.Subtract_h1;
27357 } else {
27358 /* Switch: '<S45>/Switch1' */
27359 L4_MABX_B.Switch1_fr = L4_MABX_B.UnitDelay_d;
27360 }
27361
27362 L4_MABX_B.Switch1_k4 = L4_MABX_B.Switch1_fr;
27363 }
27364
27365 /* End of Switch: '<S46>/Switch1' */
27366
27367 /* Selector: '<S42>/Selector' */
27368 L4_MABX_B.Selector_g = L4_MABX_B.Reshape_i[(int32_T)L4_MABX_B.Switch1_k4 - 1];
27369
27370 /* Outputs for Triggered SubSystem: '<S13>/CAN_TYPE1_BOR_M2_C1' incorporates:
27371 * TriggerPort: '<S41>/Trigger'
27372 */
27373 zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE == POS_ZCSIG) !=
27374 (int32_T)L4_MABX_B.Selector_g) &&
27375 (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE !=
27376 UNINITIALIZED_ZCSIG));
27377 if (zcEvent) {
27378 /* S-Function (rti_commonblock): '<S41>/S-Function1' */
27379 /* This comment workarounds a code generation problem */
27380
27381 /* dSPACE RTICAN Bus Off Recovery block */
27382 /* ... Perform software-reset of the CAN microcontroller */
27383 {
27384 UInt32 loop_counter, memory;
27385 loop_counter = 0;
27386 while ((rtican_type1_tq_error[1][0] = can_tp1_channel_BOff_return
27387 (can_type1_channel_M2_C1)) == DSMCOM_BUFFER_OVERFLOW) {
27388 loop_counter++;
27389 if (loop_counter > MAX_LOOP) {
27390 memory = rtican_type1_error_level;
27391 rtican_type1_error_level = 1;
27392 rtican_type1_tq_err_sig(1, 0);
27393 rtican_type1_error_level = memory;
27394 break;
27395 }
27396 }
27397
27398 while ((rtican_type1_tq_error[1][0] = can_tp1_channel_all_wakeup
27399 (can_type1_channel_M2_C1)) == DSMCOM_BUFFER_OVERFLOW) {
27400 loop_counter++;
27401 if (loop_counter > MAX_LOOP) {
27402 memory = rtican_type1_error_level;
27403 rtican_type1_error_level = 1;
27404 rtican_type1_tq_err_sig(1, 0);
27405 rtican_type1_error_level = memory;
27406 break;
27407 }
27408 }
27409 }
27410 }
27411
27412 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE = L4_MABX_B.Selector_g;
27413
27414 /* End of Outputs for SubSystem: '<S13>/CAN_TYPE1_BOR_M2_C1' */
27415
27416 /* RelationalOperator: '<S44>/Operator' */
27417 L4_MABX_B.Operator_dh = (L4_MABX_B.Switch1_k4 == L4_MABX_ConstB.Width_iw);
27418 }
27419
27420 /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */
27421
27422 /* S-Function (rti_commonblock): '<S19>/S-Function1' */
27423 /* This comment workarounds a code generation problem */
27424
27425 /* dSPACE RTICAN Status block */
27426 /* ... read status variables of the CAN microcontroller */
27427 {
27428 UInt32 loop_counter, memory, j;
27429 for (j=0;j<=9;j++) {
27430 rtican_type1_tq_error[1][6] = can_tp1_service_read
27431 (can_type1_service_M2_C2[j]);
27432 loop_counter = 0;
27433 while ((rtican_type1_tq_error[1][6] = can_tp1_service_request
27434 (can_type1_service_M2_C2[j]))== DSMCOM_BUFFER_OVERFLOW) {
27435 loop_counter++;
27436 if (loop_counter > MAX_LOOP) {
27437 memory = rtican_type1_error_level;
27438 rtican_type1_error_level = 1;
27439 rtican_type1_tq_err_sig(1, 6);
27440 rtican_type1_error_level = memory;
27441 break;
27442 }
27443 }
27444
27445 if (j==CANTP1_M2_C2_RXLost) {
27446 rtican_type1_tq_error[1][6] = can_tp1_service_read
27447 (can_type1_service_M2_C2[CANTP1_M2_C2_DataLost]);
27448 loop_counter = 0;
27449 while ((rtican_type1_tq_error[1][6] = can_tp1_service_request
27450 (can_type1_service_M2_C2[CANTP1_M2_C2_DataLost]))==
27451 DSMCOM_BUFFER_OVERFLOW) {
27452 loop_counter++;
27453 if (loop_counter > MAX_LOOP) {
27454 memory = rtican_type1_error_level;
27455 rtican_type1_error_level = 1;
27456 rtican_type1_tq_err_sig(1, 6);
27457 rtican_type1_error_level = memory;
27458 break;
27459 }
27460 }
27461 }
27462 }
27463
27464 L4_MABX_B.SFunction1_o1_ma = (UInt32)
27465 can_type1_service_M2_C2[CANTP1_M2_C2_Status]->data0;
27466 DIAG_CAN4_Count_Stuff_Errors = (UInt32)
27467 can_type1_service_M2_C2[CANTP1_M2_C2_StuffErrors]->data0;
27468 DIAG_CAN4_Count_Format_Errors = (UInt32)
27469 can_type1_service_M2_C2[CANTP1_M2_C2_FormatErrors]->data0;
27470 DIAG_CAN4_Count_Ack_Errors = (UInt32)
27471 can_type1_service_M2_C2[CANTP1_M2_C2_AckErrors]->data0;
27472 DIAG_CAN4_Count_Bit0_Errors = (UInt32)
27473 can_type1_service_M2_C2[CANTP1_M2_C2_Bit0Errors]->data0;
27474 DIAG_CAN4_Count_Bit1_Errors = (UInt32)
27475 can_type1_service_M2_C2[CANTP1_M2_C2_Bit1Errors]->data0;
27476 DIAG_CAN4_Count_CRC_Errors = (UInt32)
27477 can_type1_service_M2_C2[CANTP1_M2_C2_CRCErrors]->data0;
27478 DIAG_CAN4_Count_RX_Lost = (UInt32)
27479 (can_type1_service_M2_C2[CANTP1_M2_C2_RXLost]->data0 +
27480 can_type1_service_M2_C2[CANTP1_M2_C2_DataLost]->data0);
27481 DIAG_CAN4_Count_RX_OK = (UInt32) can_type1_service_M2_C2[CANTP1_M2_C2_RXOK
27482 ]->data0;
27483 DIAG_CAN4_Count_TX_OK = (UInt32) can_type1_service_M2_C2[CANTP1_M2_C2_TXOK
27484 ]->data0;
27485 }
27486
27487 /* DataTypeConversion: '<S1>/Data Type Conversion2' */
27488 DIAG_CAN4_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI
27489 ((int32_T)L4_MABX_B.SFunction1_o1_ma);
27490
27491 /* RelationalOperator: '<S25>/Operator' incorporates:
27492 * Constant: '<S1>/Constant3'
27493 */
27494 L4_MABX_B.Operator_bw = (L4_MABX_P.Constant3_Value_hq == DIAG_CAN4_Status);
27495
27496 /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_4' incorporates:
27497 * EnablePort: '<S14>/Enable'
27498 */
27499 if (L4_MABX_B.Operator_bw) {
27500 /* Reshape: '<S48>/Reshape' incorporates:
27501 * Constant: '<S48>/Constant'
27502 */
27503 L4_MABX_B.Reshape_n[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_n[0];
27504 L4_MABX_B.Reshape_n[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_n[1];
27505
27506 /* UnitDelay: '<S48>/Unit_Delay' */
27507 L4_MABX_B.Unit_Delay_fl = L4_MABX_DW.Unit_Delay_DSTATE_mq;
27508
27509 /* UnitDelay: '<S49>/Unit Delay' */
27510 L4_MABX_B.UnitDelay_l = L4_MABX_DW.UnitDelay_DSTATE_hi;
27511
27512 /* Switch: '<S52>/Switch1' incorporates:
27513 * Constant: '<S49>/E'
27514 * Constant: '<S49>/IV'
27515 * Switch: '<S51>/Switch1'
27516 */
27517 if (L4_MABX_B.Unit_Delay_fl) {
27518 L4_MABX_B.Switch1_e = L4_MABX_P.IV_Value_k;
27519 } else {
27520 if (L4_MABX_P.E_Value_m) {
27521 /* Sum: '<S49>/Subtract' incorporates:
27522 * Constant: '<S49>/Constant'
27523 * Switch: '<S51>/Switch1'
27524 */
27525 q0 = L4_MABX_P.Constant_Value_o0;
27526 qY = q0 + L4_MABX_B.UnitDelay_l;
27527 if (qY < q0) {
27528 qY = MAX_uint32_T;
27529 }
27530
27531 L4_MABX_B.Subtract_f1 = qY;
27532
27533 /* End of Sum: '<S49>/Subtract' */
27534
27535 /* Switch: '<S51>/Switch1' */
27536 L4_MABX_B.Switch1_c = L4_MABX_B.Subtract_f1;
27537 } else {
27538 /* Switch: '<S51>/Switch1' */
27539 L4_MABX_B.Switch1_c = L4_MABX_B.UnitDelay_l;
27540 }
27541
27542 L4_MABX_B.Switch1_e = L4_MABX_B.Switch1_c;
27543 }
27544
27545 /* End of Switch: '<S52>/Switch1' */
27546
27547 /* Selector: '<S48>/Selector' */
27548 L4_MABX_B.Selector_i = L4_MABX_B.Reshape_n[(int32_T)L4_MABX_B.Switch1_e - 1];
27549
27550 /* Outputs for Triggered SubSystem: '<S14>/CAN_TYPE1_BOR_M2_C2' incorporates:
27551 * TriggerPort: '<S47>/Trigger'
27552 */
27553 zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE == POS_ZCSIG) !=
27554 (int32_T)L4_MABX_B.Selector_i) &&
27555 (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE !=
27556 UNINITIALIZED_ZCSIG));
27557 if (zcEvent) {
27558 /* S-Function (rti_commonblock): '<S47>/S-Function1' */
27559 /* This comment workarounds a code generation problem */
27560
27561 /* dSPACE RTICAN Bus Off Recovery block */
27562 /* ... Perform software-reset of the CAN microcontroller */
27563 {
27564 UInt32 loop_counter, memory;
27565 loop_counter = 0;
27566 while ((rtican_type1_tq_error[1][0] = can_tp1_channel_BOff_return
27567 (can_type1_channel_M2_C2)) == DSMCOM_BUFFER_OVERFLOW) {
27568 loop_counter++;
27569 if (loop_counter > MAX_LOOP) {
27570 memory = rtican_type1_error_level;
27571 rtican_type1_error_level = 1;
27572 rtican_type1_tq_err_sig(1, 0);
27573 rtican_type1_error_level = memory;
27574 break;
27575 }
27576 }
27577
27578 while ((rtican_type1_tq_error[1][0] = can_tp1_channel_all_wakeup
27579 (can_type1_channel_M2_C2)) == DSMCOM_BUFFER_OVERFLOW) {
27580 loop_counter++;
27581 if (loop_counter > MAX_LOOP) {
27582 memory = rtican_type1_error_level;
27583 rtican_type1_error_level = 1;
27584 rtican_type1_tq_err_sig(1, 0);
27585 rtican_type1_error_level = memory;
27586 break;
27587 }
27588 }
27589 }
27590 }
27591
27592 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE = L4_MABX_B.Selector_i;
27593
27594 /* End of Outputs for SubSystem: '<S14>/CAN_TYPE1_BOR_M2_C2' */
27595
27596 /* RelationalOperator: '<S50>/Operator' */
27597 L4_MABX_B.Operator_ou = (L4_MABX_B.Switch1_e == L4_MABX_ConstB.Width_i);
27598 }
27599
27600 /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */
27601
27602 /* S-Function (rti_commonblock): '<S17>/S-Function1' */
27603 /* This comment workarounds a code generation problem */
27604
27605 /* dSPACE RTICAN Status block */
27606 /* ... read status variables of the CAN microcontroller */
27607 {
27608 UInt32 loop_counter, memory, j;
27609 for (j=0;j<=9;j++) {
27610 rtican_type1_tq_error[0][6] = can_tp1_service_read
27611 (can_type1_service_M1_C2[j]);
27612 loop_counter = 0;
27613 while ((rtican_type1_tq_error[0][6] = can_tp1_service_request
27614 (can_type1_service_M1_C2[j]))== DSMCOM_BUFFER_OVERFLOW) {
27615 loop_counter++;
27616 if (loop_counter > MAX_LOOP) {
27617 memory = rtican_type1_error_level;
27618 rtican_type1_error_level = 1;
27619 rtican_type1_tq_err_sig(0, 6);
27620 rtican_type1_error_level = memory;
27621 break;
27622 }
27623 }
27624
27625 if (j==CANTP1_M1_C2_RXLost) {
27626 rtican_type1_tq_error[0][6] = can_tp1_service_read
27627 (can_type1_service_M1_C2[CANTP1_M1_C2_DataLost]);
27628 loop_counter = 0;
27629 while ((rtican_type1_tq_error[0][6] = can_tp1_service_request
27630 (can_type1_service_M1_C2[CANTP1_M1_C2_DataLost]))==
27631 DSMCOM_BUFFER_OVERFLOW) {
27632 loop_counter++;
27633 if (loop_counter > MAX_LOOP) {
27634 memory = rtican_type1_error_level;
27635 rtican_type1_error_level = 1;
27636 rtican_type1_tq_err_sig(0, 6);
27637 rtican_type1_error_level = memory;
27638 break;
27639 }
27640 }
27641 }
27642 }
27643
27644 L4_MABX_B.SFunction1_o1_og = (UInt32)
27645 can_type1_service_M1_C2[CANTP1_M1_C2_Status]->data0;
27646 DIAG_CAN2_Count_Stuff_Errors = (UInt32)
27647 can_type1_service_M1_C2[CANTP1_M1_C2_StuffErrors]->data0;
27648 DIAG_CAN2_Count_Format_Errors = (UInt32)
27649 can_type1_service_M1_C2[CANTP1_M1_C2_FormatErrors]->data0;
27650 DIAG_CAN2_Count_Ack_Errors = (UInt32)
27651 can_type1_service_M1_C2[CANTP1_M1_C2_AckErrors]->data0;
27652 DIAG_CAN2_Count_Bit0_Errors = (UInt32)
27653 can_type1_service_M1_C2[CANTP1_M1_C2_Bit0Errors]->data0;
27654 DIAG_CAN2_Count_Bit1_Errors = (UInt32)
27655 can_type1_service_M1_C2[CANTP1_M1_C2_Bit1Errors]->data0;
27656 DIAG_CAN2_Count_CRC_Errors = (UInt32)
27657 can_type1_service_M1_C2[CANTP1_M1_C2_CRCErrors]->data0;
27658 DIAG_CAN2_Count_RX_Lost = (UInt32)
27659 (can_type1_service_M1_C2[CANTP1_M1_C2_RXLost]->data0 +
27660 can_type1_service_M1_C2[CANTP1_M1_C2_DataLost]->data0);
27661 DIAG_CAN2_Count_RX_OK = (UInt32) can_type1_service_M1_C2[CANTP1_M1_C2_RXOK
27662 ]->data0;
27663 DIAG_CAN2_Count_TX_OK = (UInt32) can_type1_service_M1_C2[CANTP1_M1_C2_TXOK
27664 ]->data0;
27665 }
27666
27667 /* DataTypeConversion: '<S1>/Data Type Conversion1' */
27668 DIAG_CAN2_Status = (ENUM_CAN_STATUS_DIAG_T)safe_cast_to_ENUM_CAN_STATUS_DI
27669 ((int32_T)L4_MABX_B.SFunction1_o1_og);
27670
27671 /* RelationalOperator: '<S23>/Operator' incorporates:
27672 * Constant: '<S1>/Constant2'
27673 */
27674 L4_MABX_B.Operator_eb = (L4_MABX_P.Constant2_Value_j == DIAG_CAN2_Status);
27675
27676 /* Outputs for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_2' incorporates:
27677 * EnablePort: '<S12>/Enable'
27678 */
27679 if (L4_MABX_B.Operator_eb) {
27680 /* Reshape: '<S36>/Reshape' incorporates:
27681 * Constant: '<S36>/Constant'
27682 */
27683 L4_MABX_B.Reshape_a5[0] = L4_MABX_P.Repeating_Sequence_Stair_OutV_d[0];
27684 L4_MABX_B.Reshape_a5[1] = L4_MABX_P.Repeating_Sequence_Stair_OutV_d[1];
27685
27686 /* UnitDelay: '<S36>/Unit_Delay' */
27687 L4_MABX_B.Unit_Delay_g = L4_MABX_DW.Unit_Delay_DSTATE_je;
27688
27689 /* UnitDelay: '<S37>/Unit Delay' */
27690 L4_MABX_B.UnitDelay_bw = L4_MABX_DW.UnitDelay_DSTATE_b;
27691
27692 /* Switch: '<S40>/Switch1' incorporates:
27693 * Constant: '<S37>/E'
27694 * Constant: '<S37>/IV'
27695 * Switch: '<S39>/Switch1'
27696 */
27697 if (L4_MABX_B.Unit_Delay_g) {
27698 L4_MABX_B.Switch1_i = L4_MABX_P.IV_Value_e;
27699 } else {
27700 if (L4_MABX_P.E_Value_l) {
27701 /* Sum: '<S37>/Subtract' incorporates:
27702 * Constant: '<S37>/Constant'
27703 * Switch: '<S39>/Switch1'
27704 */
27705 q0 = L4_MABX_P.Constant_Value_ae;
27706 qY = q0 + L4_MABX_B.UnitDelay_bw;
27707 if (qY < q0) {
27708 qY = MAX_uint32_T;
27709 }
27710
27711 L4_MABX_B.Subtract_nc = qY;
27712
27713 /* End of Sum: '<S37>/Subtract' */
27714
27715 /* Switch: '<S39>/Switch1' */
27716 L4_MABX_B.Switch1_hm = L4_MABX_B.Subtract_nc;
27717 } else {
27718 /* Switch: '<S39>/Switch1' */
27719 L4_MABX_B.Switch1_hm = L4_MABX_B.UnitDelay_bw;
27720 }
27721
27722 L4_MABX_B.Switch1_i = L4_MABX_B.Switch1_hm;
27723 }
27724
27725 /* End of Switch: '<S40>/Switch1' */
27726
27727 /* Selector: '<S36>/Selector' */
27728 L4_MABX_B.Selector_b = L4_MABX_B.Reshape_a5[(int32_T)L4_MABX_B.Switch1_i - 1];
27729
27730 /* Outputs for Triggered SubSystem: '<S12>/CAN_TYPE1_BOR_M1_C2' incorporates:
27731 * TriggerPort: '<S35>/Trigger'
27732 */
27733 zcEvent = (((L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE == POS_ZCSIG) !=
27734 (int32_T)L4_MABX_B.Selector_b) &&
27735 (L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE !=
27736 UNINITIALIZED_ZCSIG));
27737 if (zcEvent) {
27738 /* S-Function (rti_commonblock): '<S35>/S-Function1' */
27739 /* This comment workarounds a code generation problem */
27740
27741 /* dSPACE RTICAN Bus Off Recovery block */
27742 /* ... Perform software-reset of the CAN microcontroller */
27743 {
27744 UInt32 loop_counter, memory;
27745 loop_counter = 0;
27746 while ((rtican_type1_tq_error[0][0] = can_tp1_channel_BOff_return
27747 (can_type1_channel_M1_C2)) == DSMCOM_BUFFER_OVERFLOW) {
27748 loop_counter++;
27749 if (loop_counter > MAX_LOOP) {
27750 memory = rtican_type1_error_level;
27751 rtican_type1_error_level = 1;
27752 rtican_type1_tq_err_sig(0, 0);
27753 rtican_type1_error_level = memory;
27754 break;
27755 }
27756 }
27757
27758 while ((rtican_type1_tq_error[0][0] = can_tp1_channel_all_wakeup
27759 (can_type1_channel_M1_C2)) == DSMCOM_BUFFER_OVERFLOW) {
27760 loop_counter++;
27761 if (loop_counter > MAX_LOOP) {
27762 memory = rtican_type1_error_level;
27763 rtican_type1_error_level = 1;
27764 rtican_type1_tq_err_sig(0, 0);
27765 rtican_type1_error_level = memory;
27766 break;
27767 }
27768 }
27769 }
27770 }
27771
27772 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE = L4_MABX_B.Selector_b;
27773
27774 /* End of Outputs for SubSystem: '<S12>/CAN_TYPE1_BOR_M1_C2' */
27775
27776 /* RelationalOperator: '<S38>/Operator' */
27777 L4_MABX_B.Operator_bsv = (L4_MABX_B.Switch1_i == L4_MABX_ConstB.Width_g);
27778 }
27779
27780 /* End of Outputs for SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */
27781 /* user code (Output function Trailer for TID5) */
27782
27783 /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */
27784 /* EventChannel: 0 */
27785 if (tid == 0) {
27786 DSXCP_service(0);
27787 }
27788
27789 /* If subsystem generates rate grouping Output functions,
27790 * when tid is used in Output function for one rate,
27791 * all Output functions include tid as a local variable.
27792 * As result, some Output functions may have unused tid.
27793 */
27794 UNUSED_PARAMETER(tid);
27795}
27796
27797/* Model update function for TID5 */
27798void L4_MABX_update5(void) /* Sample time: [0.5s, 0.0s] */
27799{
27800 /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_1' incorporates:
27801 * EnablePort: '<S11>/Enable'
27802 */
27803 if (L4_MABX_B.Operator_eu) {
27804 /* Update for UnitDelay: '<S30>/Unit_Delay' */
27805 L4_MABX_DW.Unit_Delay_DSTATE_f1 = L4_MABX_B.Operator_f5;
27806
27807 /* Update for UnitDelay: '<S31>/Unit Delay' */
27808 L4_MABX_DW.UnitDelay_DSTATE_j1 = L4_MABX_B.Switch1_o;
27809 }
27810
27811 /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */
27812
27813 /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_5' incorporates:
27814 * EnablePort: '<S15>/Enable'
27815 */
27816 if (L4_MABX_B.Operator_msz) {
27817 /* Update for UnitDelay: '<S54>/Unit_Delay' */
27818 L4_MABX_DW.Unit_Delay_DSTATE_i5 = L4_MABX_B.Operator_ho;
27819
27820 /* Update for UnitDelay: '<S55>/Unit Delay' */
27821 L4_MABX_DW.UnitDelay_DSTATE_p = L4_MABX_B.Switch1_k;
27822 }
27823
27824 /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */
27825
27826 /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_6' incorporates:
27827 * EnablePort: '<S16>/Enable'
27828 */
27829 if (L4_MABX_B.Operator_fv) {
27830 /* Update for UnitDelay: '<S60>/Unit_Delay' */
27831 L4_MABX_DW.Unit_Delay_DSTATE_l5 = L4_MABX_B.Operator_bg;
27832
27833 /* Update for UnitDelay: '<S61>/Unit Delay' */
27834 L4_MABX_DW.UnitDelay_DSTATE_dr = L4_MABX_B.Switch1_ht;
27835 }
27836
27837 /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */
27838
27839 /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_3' incorporates:
27840 * EnablePort: '<S13>/Enable'
27841 */
27842 if (L4_MABX_B.Operator_bs) {
27843 /* Update for UnitDelay: '<S42>/Unit_Delay' */
27844 L4_MABX_DW.Unit_Delay_DSTATE_h41 = L4_MABX_B.Operator_dh;
27845
27846 /* Update for UnitDelay: '<S43>/Unit Delay' */
27847 L4_MABX_DW.UnitDelay_DSTATE_dr4 = L4_MABX_B.Switch1_k4;
27848 }
27849
27850 /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */
27851
27852 /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_4' incorporates:
27853 * EnablePort: '<S14>/Enable'
27854 */
27855 if (L4_MABX_B.Operator_bw) {
27856 /* Update for UnitDelay: '<S48>/Unit_Delay' */
27857 L4_MABX_DW.Unit_Delay_DSTATE_mq = L4_MABX_B.Operator_ou;
27858
27859 /* Update for UnitDelay: '<S49>/Unit Delay' */
27860 L4_MABX_DW.UnitDelay_DSTATE_hi = L4_MABX_B.Switch1_e;
27861 }
27862
27863 /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */
27864
27865 /* Update for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_2' incorporates:
27866 * EnablePort: '<S12>/Enable'
27867 */
27868 if (L4_MABX_B.Operator_eb) {
27869 /* Update for UnitDelay: '<S36>/Unit_Delay' */
27870 L4_MABX_DW.Unit_Delay_DSTATE_je = L4_MABX_B.Operator_bsv;
27871
27872 /* Update for UnitDelay: '<S37>/Unit Delay' */
27873 L4_MABX_DW.UnitDelay_DSTATE_b = L4_MABX_B.Switch1_i;
27874 }
27875
27876 /* End of Update for SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */
27877}
27878
27879/* Model output function for TID6 */
27880void L4_MABX_output6(void) /* Sample time: [1.0s, 0.0s] */
27881{
27882 int_T tid = 6;
27883
27884 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_1000ms' */
27885
27886 /* DataTypeConversion: '<S861>/Data Type Conversion' incorporates:
27887 * Constant: '<S852>/Constant2'
27888 */
27889 L4_MABX_B.DataTypeConversion_l5 = (uint8_T)L4_MABX_P.Constant2_Value_c;
27890
27891 /* S-Function (sfix_bitop): '<S866>/Operator' */
27892 L4_MABX_B.Operator_jg0 = (uint8_T)(L4_MABX_B.DataTypeConversion_l5 &
27893 L4_MABX_P.Operator_BitMask);
27894
27895 /* DataTypeConversion: '<S866>/DataType' */
27896 L4_MABX_B.DataType_o3 = L4_MABX_B.Operator_jg0;
27897
27898 /* ArithShift: '<S861>/Shift_Arithmetic 2' */
27899 L4_MABX_B.Shift_Arithmetic2_g = ldexp(L4_MABX_B.DataType_o3, (-3));
27900
27901 /* DataTypeConversion: '<S861>/Data Type Conversion5' */
27902 L4_MABX_B.DataTypeConversion5_cj = (L4_MABX_B.Shift_Arithmetic2_g != 0.0);
27903
27904 /* Outputs for Enabled SubSystem: '<S869>/AIR1' incorporates:
27905 * EnablePort: '<S870>/Enable'
27906 */
27907 if (L4_MABX_B.DataTypeConversion5_cj) {
27908 /* S-Function (rti_commonblock): '<S870>/S-Function1' */
27909 /* This comment workarounds a code generation problem */
27910
27911 /* dSPACE RTICAN TX Message Block: "AIR1" Id:419343921 */
27912 {
27913 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
27914
27915 Float32 delayTime = 0.0;
27916
27917 /* ... Read status and timestamp info (previous message) */
27918 can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]);
27919
27920 /* Convert timestamp */
27921 if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->processed) {
27922 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp =
27923 rtk_dsts_time_to_simtime_convert
27924 (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp);
27925 }
27926
27927 /* Messages with timestamp zero have been received in pause/stop state
27928 and must not be handled.
27929 */
27930 if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp > 0.0) {
27931 L4_MABX_B.SFunction1_o1_i = (real_T)
27932 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->processed;
27933 L4_MABX_B.SFunction1_o2_jb = (real_T)
27934 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->timestamp;
27935 L4_MABX_B.SFunction1_o3_a = (real_T)
27936 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->deltatime;
27937 L4_MABX_B.SFunction1_o4_i = (real_T)
27938 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31]->delaytime;
27939 }
27940
27941 /* ... Encode Simulink signals of TX and RM blocks*/
27942 {
27943 rtican_Signal_t CAN_Sgn;
27944
27945 /* ...... "PneumaticSupplyPress" (0|8, standard signal, unsigned int, little endian) */
27946 /* Add or substract 0.5 in order to round to nearest integer */
27947 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.PneumaticSupplyPress - ( 0 )
27948 ) / 8 + 0.5);
27949 CAN_Sgn.UnsignedSgn &= 0x000000FF;
27950 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
27951
27952 /* ...... "ParkingAnd_orTrailerAirPress" (8|8, standard signal, unsigned int, little endian) */
27953 /* Add or substract 0.5 in order to round to nearest integer */
27954 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ParkingAnd_orTrailerAirPress
27955 - ( 0 ) ) / 8 + 0.5);
27956 CAN_Sgn.UnsignedSgn &= 0x000000FF;
27957 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
27958
27959 /* ...... "ServiceBrakeCircuit1AirPress" (16|8, standard signal, unsigned int, little endian) */
27960 /* Add or substract 0.5 in order to round to nearest integer */
27961 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ServiceBrakeCircuit1AirPress
27962 - ( 0 ) ) / 8 + 0.5);
27963 CAN_Sgn.UnsignedSgn &= 0x000000FF;
27964 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
27965
27966 /* ...... "ServiceBrakeCircuit2AirPress" (24|8, standard signal, unsigned int, little endian) */
27967 /* Add or substract 0.5 in order to round to nearest integer */
27968 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.ServiceBrakeCircuit2AirPress
27969 - ( 0 ) ) / 8 + 0.5);
27970 CAN_Sgn.UnsignedSgn &= 0x000000FF;
27971 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
27972
27973 /* ...... "AuxEquipmentSupplyPress" (32|8, standard signal, unsigned int, little endian) */
27974 /* Add or substract 0.5 in order to round to nearest integer */
27975 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AuxEquipmentSupplyPress -
27976 ( 0 ) ) / 8 + 0.5);
27977 CAN_Sgn.UnsignedSgn &= 0x000000FF;
27978 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte0;
27979
27980 /* ...... "AirSuspensionSupplyPress" (40|8, standard signal, unsigned int, little endian) */
27981 /* Add or substract 0.5 in order to round to nearest integer */
27982 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AirSuspensionSupplyPress - (
27983 0 ) ) / 8 + 0.5);
27984 CAN_Sgn.UnsignedSgn &= 0x000000FF;
27985 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
27986
27987 /* ...... "AirCompressorStatus" (48|2, standard signal, unsigned int, little endian) */
27988 /* Add or substract 0.5 in order to round to nearest integer */
27989 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AirCompressorStatus ) + 0.5);
27990 CAN_Sgn.UnsignedSgn &= 0x00000003;
27991 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
27992
27993 /* ...... "PowertrainCircuitAirSupplyPress" (56|8, standard signal, unsigned int, little endian) */
27994 /* Add or substract 0.5 in order to round to nearest integer */
27995 CAN_Sgn.UnsignedSgn = (UInt32)
27996 (( L4_MABX_B.PowertrainCircuitAirSupplyPress - ( 0 ) ) / 8 + 0.5);
27997 CAN_Sgn.UnsignedSgn &= 0x000000FF;
27998 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte0;
27999 }
28000
28001 /* mask unused bits with '1' */
28002 CAN_Msg[6] |= 0xFC;
28003
28004 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
28005 can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31], 8,
28006 &(CAN_Msg[0]), delayTime);
28007 }
28008 }
28009
28010 /* End of Outputs for SubSystem: '<S869>/AIR1' */
28011
28012 /* S-Function (sfix_bitop): '<S863>/Operator' */
28013 L4_MABX_B.Operator_ow = (uint8_T)(L4_MABX_B.DataTypeConversion_l5 &
28014 L4_MABX_P.Operator_BitMask_o);
28015
28016 /* DataTypeConversion: '<S863>/DataType' */
28017 L4_MABX_B.DataType_gj = L4_MABX_B.Operator_ow;
28018
28019 /* S-Function (sfix_bitop): '<S864>/Operator' */
28020 L4_MABX_B.Operator_jy = (uint8_T)(L4_MABX_B.DataTypeConversion_l5 &
28021 L4_MABX_P.Operator_BitMask_h);
28022
28023 /* DataTypeConversion: '<S864>/DataType' */
28024 L4_MABX_B.DataType_h1 = L4_MABX_B.Operator_jy;
28025
28026 /* S-Function (sfix_bitop): '<S865>/Operator' */
28027 L4_MABX_B.Operator_gh = (uint8_T)(L4_MABX_B.DataTypeConversion_l5 &
28028 L4_MABX_P.Operator_BitMask_j);
28029
28030 /* DataTypeConversion: '<S865>/DataType' */
28031 L4_MABX_B.DataType_i = L4_MABX_B.Operator_gh;
28032
28033 /* S-Function (sfix_bitop): '<S867>/Operator' */
28034 L4_MABX_B.Operator_auf = (uint8_T)(L4_MABX_B.DataTypeConversion_l5 &
28035 L4_MABX_P.Operator_BitMask_d);
28036
28037 /* DataTypeConversion: '<S867>/DataType' */
28038 L4_MABX_B.DataType_ls = L4_MABX_B.Operator_auf;
28039
28040 /* S-Function (sfix_bitop): '<S868>/Operator' */
28041 L4_MABX_B.Operator_ha = (uint8_T)(L4_MABX_B.DataTypeConversion_l5 &
28042 L4_MABX_P.Operator_BitMask_e);
28043
28044 /* DataTypeConversion: '<S868>/DataType' */
28045 L4_MABX_B.DataType_j = L4_MABX_B.Operator_ha;
28046
28047 /* DataTypeConversion: '<S861>/Data Type Conversion2' */
28048 L4_MABX_B.DataTypeConversion2_lc = (L4_MABX_B.DataType_gj != 0);
28049
28050 /* ArithShift: '<S861>/Shift_Arithmetic ' */
28051 L4_MABX_B.Shift_Arithmetic_a = ldexp(L4_MABX_B.DataType_h1, (-1));
28052
28053 /* DataTypeConversion: '<S861>/Data Type Conversion3' */
28054 L4_MABX_B.DataTypeConversion3_iq = (L4_MABX_B.Shift_Arithmetic_a != 0.0);
28055
28056 /* ArithShift: '<S861>/Shift_Arithmetic 1' */
28057 L4_MABX_B.Shift_Arithmetic1_gq = ldexp(L4_MABX_B.DataType_i, (-2));
28058
28059 /* DataTypeConversion: '<S861>/Data Type Conversion4' */
28060 L4_MABX_B.DataTypeConversion4_mt = (L4_MABX_B.Shift_Arithmetic1_gq != 0.0);
28061
28062 /* ArithShift: '<S861>/Shift_Arithmetic 3' */
28063 L4_MABX_B.Shift_Arithmetic3_f = ldexp(L4_MABX_B.DataType_ls, (-4));
28064
28065 /* DataTypeConversion: '<S861>/Data Type Conversion6' */
28066 L4_MABX_B.DataTypeConversion6_cj = (L4_MABX_B.Shift_Arithmetic3_f != 0.0);
28067
28068 /* ArithShift: '<S861>/Shift_Arithmetic 4' */
28069 L4_MABX_B.Shift_Arithmetic4_g = ldexp(L4_MABX_B.DataType_j, (-5));
28070
28071 /* DataTypeConversion: '<S861>/Data Type Conversion7' */
28072 L4_MABX_B.DataTypeConversion7_gj = (L4_MABX_B.Shift_Arithmetic4_g != 0.0);
28073
28074 /* DataTypeConversion: '<S862>/Data Type Conversion' incorporates:
28075 * Constant: '<S852>/Constant1'
28076 */
28077 L4_MABX_B.DataTypeConversion_p32 = (uint8_T)L4_MABX_P.Constant1_Value_ie;
28078
28079 /* S-Function (sfix_bitop): '<S874>/Operator' */
28080 L4_MABX_B.Operator_fy = (uint8_T)(L4_MABX_B.DataTypeConversion_p32 &
28081 L4_MABX_P.Operator_BitMask_n);
28082
28083 /* DataTypeConversion: '<S874>/DataType' */
28084 L4_MABX_B.DataType_dp = L4_MABX_B.Operator_fy;
28085
28086 /* ArithShift: '<S862>/Shift_Arithmetic 2' */
28087 L4_MABX_B.Shift_Arithmetic2_p = ldexp(L4_MABX_B.DataType_dp, (-3));
28088
28089 /* DataTypeConversion: '<S862>/Data Type Conversion5' */
28090 L4_MABX_B.DataTypeConversion5_hy = (L4_MABX_B.Shift_Arithmetic2_p != 0.0);
28091
28092 /* Outputs for Enabled SubSystem: '<S877>/AMB' incorporates:
28093 * EnablePort: '<S878>/Enable'
28094 */
28095 if (L4_MABX_B.DataTypeConversion5_hy) {
28096 /* S-Function (rti_commonblock): '<S878>/S-Function1' */
28097 /* This comment workarounds a code generation problem */
28098
28099 /* dSPACE RTICAN TX Message Block: "AMB" Id:419362048 */
28100 {
28101 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
28102
28103 Float32 delayTime = 0.0;
28104
28105 /* ... Read status and timestamp info (previous message) */
28106 can_tp1_msg_read(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]);
28107
28108 /* Convert timestamp */
28109 if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->processed) {
28110 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp =
28111 rtk_dsts_time_to_simtime_convert
28112 (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp);
28113 }
28114
28115 /* Messages with timestamp zero have been received in pause/stop state
28116 and must not be handled.
28117 */
28118 if (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp > 0.0) {
28119 L4_MABX_B.SFunction1_o1_lh = (real_T)
28120 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->processed;
28121 L4_MABX_B.SFunction1_o2_og = (real_T)
28122 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->timestamp;
28123 L4_MABX_B.SFunction1_o3_nw3 = (real_T)
28124 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->deltatime;
28125 L4_MABX_B.SFunction1_o4_dn = (real_T)
28126 can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500]->delaytime;
28127 }
28128
28129 /* ... Encode Simulink signals of TX and RM blocks*/
28130 {
28131 rtican_Signal_t CAN_Sgn;
28132
28133 /* ...... "BarometricPress" (0|8, standard signal, unsigned int, little endian) */
28134 /* Add or substract 0.5 in order to round to nearest integer */
28135 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.BarometricPress_h - ( 0 ) ) /
28136 0.5 + 0.5);
28137 CAN_Sgn.UnsignedSgn &= 0x000000FF;
28138 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
28139
28140 /* ...... "CabInteriorTemp" (8|16, standard signal, unsigned int, little endian) */
28141 /* Add or substract 0.5 in order to round to nearest integer */
28142 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.CabInteriorTemp - ( -273 ) )
28143 / 0.03125 + 0.5);
28144 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
28145 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
28146 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte1;
28147
28148 /* ...... "AmbientAirTemp" (24|16, standard signal, unsigned int, little endian) */
28149 /* Add or substract 0.5 in order to round to nearest integer */
28150 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.AmbientAirTemp_h - ( -273 ) )
28151 / 0.03125 + 0.5);
28152 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
28153 CAN_Msg[3] |= CAN_Sgn.SgnBytes.Byte0;
28154 CAN_Msg[4] |= CAN_Sgn.SgnBytes.Byte1;
28155
28156 /* ...... "EngAirIntakeTemp" (40|8, standard signal, unsigned int, little endian) */
28157 /* Add or substract 0.5 in order to round to nearest integer */
28158 CAN_Sgn.UnsignedSgn = (UInt32) (L4_MABX_B.EngAirIntakeTemp - ( -40 ) +
28159 0.5);
28160 CAN_Sgn.UnsignedSgn &= 0x000000FF;
28161 CAN_Msg[5] |= CAN_Sgn.SgnBytes.Byte0;
28162
28163 /* ...... "RoadSurfaceTemp" (48|16, standard signal, unsigned int, little endian) */
28164 /* Add or substract 0.5 in order to round to nearest integer */
28165 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.RoadSurfaceTemp - ( -273 ) )
28166 / 0.03125 + 0.5);
28167 CAN_Sgn.UnsignedSgn &= 0x0000FFFF;
28168 CAN_Msg[6] |= CAN_Sgn.SgnBytes.Byte0;
28169 CAN_Msg[7] |= CAN_Sgn.SgnBytes.Byte1;
28170 }
28171
28172 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
28173 can_tp1_msg_send(can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500], 8,
28174 &(CAN_Msg[0]), delayTime);
28175 }
28176 }
28177
28178 /* End of Outputs for SubSystem: '<S877>/AMB' */
28179
28180 /* S-Function (sfix_bitop): '<S871>/Operator' */
28181 L4_MABX_B.Operator_ia = (uint8_T)(L4_MABX_B.DataTypeConversion_p32 &
28182 L4_MABX_P.Operator_BitMask_c);
28183
28184 /* DataTypeConversion: '<S871>/DataType' */
28185 L4_MABX_B.DataType_n1 = L4_MABX_B.Operator_ia;
28186
28187 /* S-Function (sfix_bitop): '<S872>/Operator' */
28188 L4_MABX_B.Operator_db = (uint8_T)(L4_MABX_B.DataTypeConversion_p32 &
28189 L4_MABX_P.Operator_BitMask_k);
28190
28191 /* DataTypeConversion: '<S872>/DataType' */
28192 L4_MABX_B.DataType_mv = L4_MABX_B.Operator_db;
28193
28194 /* S-Function (sfix_bitop): '<S873>/Operator' */
28195 L4_MABX_B.Operator_pw = (uint8_T)(L4_MABX_B.DataTypeConversion_p32 &
28196 L4_MABX_P.Operator_BitMask_cz);
28197
28198 /* DataTypeConversion: '<S873>/DataType' */
28199 L4_MABX_B.DataType_e = L4_MABX_B.Operator_pw;
28200
28201 /* S-Function (sfix_bitop): '<S875>/Operator' */
28202 L4_MABX_B.Operator_go = (uint8_T)(L4_MABX_B.DataTypeConversion_p32 &
28203 L4_MABX_P.Operator_BitMask_l);
28204
28205 /* DataTypeConversion: '<S875>/DataType' */
28206 L4_MABX_B.DataType_gw = L4_MABX_B.Operator_go;
28207
28208 /* S-Function (sfix_bitop): '<S876>/Operator' */
28209 L4_MABX_B.Operator_nt = (uint8_T)(L4_MABX_B.DataTypeConversion_p32 &
28210 L4_MABX_P.Operator_BitMask_a);
28211
28212 /* DataTypeConversion: '<S876>/DataType' */
28213 L4_MABX_B.DataType_fk = L4_MABX_B.Operator_nt;
28214
28215 /* DataTypeConversion: '<S862>/Data Type Conversion2' */
28216 L4_MABX_B.DataTypeConversion2_bu = (L4_MABX_B.DataType_n1 != 0);
28217
28218 /* ArithShift: '<S862>/Shift_Arithmetic ' */
28219 L4_MABX_B.Shift_Arithmetic_pg = ldexp(L4_MABX_B.DataType_mv, (-1));
28220
28221 /* DataTypeConversion: '<S862>/Data Type Conversion3' */
28222 L4_MABX_B.DataTypeConversion3_ld = (L4_MABX_B.Shift_Arithmetic_pg != 0.0);
28223
28224 /* ArithShift: '<S862>/Shift_Arithmetic 1' */
28225 L4_MABX_B.Shift_Arithmetic1_m = ldexp(L4_MABX_B.DataType_e, (-2));
28226
28227 /* DataTypeConversion: '<S862>/Data Type Conversion4' */
28228 L4_MABX_B.DataTypeConversion4_kz = (L4_MABX_B.Shift_Arithmetic1_m != 0.0);
28229
28230 /* ArithShift: '<S862>/Shift_Arithmetic 3' */
28231 L4_MABX_B.Shift_Arithmetic3_d = ldexp(L4_MABX_B.DataType_gw, (-4));
28232
28233 /* DataTypeConversion: '<S862>/Data Type Conversion6' */
28234 L4_MABX_B.DataTypeConversion6_ew = (L4_MABX_B.Shift_Arithmetic3_d != 0.0);
28235
28236 /* ArithShift: '<S862>/Shift_Arithmetic 4' */
28237 L4_MABX_B.Shift_Arithmetic4_gy = ldexp(L4_MABX_B.DataType_fk, (-5));
28238
28239 /* DataTypeConversion: '<S862>/Data Type Conversion7' */
28240 L4_MABX_B.DataTypeConversion7_im = (L4_MABX_B.Shift_Arithmetic4_gy != 0.0);
28241
28242 /* End of Outputs for SubSystem: '<S849>/CAN_TX_1000ms' */
28243 /* user code (Output function Trailer for TID6) */
28244
28245 /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */
28246 /* EventChannel: 0 */
28247 if (tid == 0) {
28248 DSXCP_service(0);
28249 }
28250
28251 /* If subsystem generates rate grouping Output functions,
28252 * when tid is used in Output function for one rate,
28253 * all Output functions include tid as a local variable.
28254 * As result, some Output functions may have unused tid.
28255 */
28256 UNUSED_PARAMETER(tid);
28257}
28258
28259/* Model update function for TID6 */
28260void L4_MABX_update6(void) /* Sample time: [1.0s, 0.0s] */
28261{
28262 /* (no update code required) */
28263}
28264
28265/* Model output function for TID7 */
28266void L4_MABX_output7(void) /* Sample time: [5.0s, 0.0s] */
28267{
28268 int_T tid = 7;
28269 int32_T i;
28270 uint16_T tmp;
28271 uint32_T q0;
28272 uint32_T qY;
28273
28274 /* Outputs for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */
28275
28276 /* DataTypeConversion: '<S1040>/Data Type Conversion6' incorporates:
28277 * Constant: '<S1040>/Enable_TX_RequestDiagMsgFromREAX'
28278 */
28279 L4_MABX_B.DataTypeConversion6_c = L4_MABX_P.Enable_TX_RequestDiagMsgFromREA;
28280
28281 /* Logic: '<S1044>/Operator' */
28282 L4_MABX_B.Operator_nr = (L4_MABX_B.DataTypeConversion6_c &&
28283 L4_MABX_B.TmpRTBAtOperatorInport2);
28284
28285 /* DataTypeConversion: '<S1044>/DataType' */
28286 L4_MABX_B.DataType_eq = L4_MABX_B.Operator_nr;
28287
28288 /* Reshape: '<S1049>/Reshape' incorporates:
28289 * Constant: '<S1049>/Constant'
28290 */
28291 for (i = 0; i < 8; i++) {
28292 L4_MABX_B.Reshape[i] = L4_MABX_P.Repeating_Sequence_Stair_OutVal[i];
28293 }
28294
28295 /* End of Reshape: '<S1049>/Reshape' */
28296
28297 /* UnitDelay: '<S1049>/Unit_Delay' */
28298 L4_MABX_B.Unit_Delay_o = L4_MABX_DW.Unit_Delay_DSTATE_ek;
28299
28300 /* UnitDelay: '<S1050>/Unit Delay' */
28301 L4_MABX_B.UnitDelay_ol = L4_MABX_DW.UnitDelay_DSTATE_h;
28302
28303 /* Switch: '<S1053>/Switch1' incorporates:
28304 * Constant: '<S1050>/E'
28305 * Constant: '<S1050>/IV'
28306 * Switch: '<S1052>/Switch1'
28307 */
28308 if (L4_MABX_B.Unit_Delay_o) {
28309 L4_MABX_B.Switch1_a = L4_MABX_P.IV_Value_n;
28310 } else {
28311 if (L4_MABX_P.E_Value_cd) {
28312 /* Sum: '<S1050>/Subtract' incorporates:
28313 * Constant: '<S1050>/Constant'
28314 * Switch: '<S1052>/Switch1'
28315 */
28316 q0 = L4_MABX_P.Constant_Value_gb;
28317 qY = q0 + L4_MABX_B.UnitDelay_ol;
28318 if (qY < q0) {
28319 qY = MAX_uint32_T;
28320 }
28321
28322 L4_MABX_B.Subtract_h = qY;
28323
28324 /* End of Sum: '<S1050>/Subtract' */
28325
28326 /* Switch: '<S1052>/Switch1' */
28327 L4_MABX_B.Switch1_g = L4_MABX_B.Subtract_h;
28328 } else {
28329 /* Switch: '<S1052>/Switch1' */
28330 L4_MABX_B.Switch1_g = L4_MABX_B.UnitDelay_ol;
28331 }
28332
28333 L4_MABX_B.Switch1_a = L4_MABX_B.Switch1_g;
28334 }
28335
28336 /* End of Switch: '<S1053>/Switch1' */
28337
28338 /* Selector: '<S1049>/Selector' */
28339 L4_MABX_B.Selector = L4_MABX_B.Reshape[(int32_T)L4_MABX_B.Switch1_a - 1];
28340
28341 /* DataTypeConversion: '<S1041>/Data Type Conversion' */
28342 L4_MABX_B.DataTypeConversion_lx = L4_MABX_B.Selector;
28343
28344 /* S-Function (sfix_bitop): '<S1046>/Operator' */
28345 L4_MABX_B.Operator = L4_MABX_B.DataTypeConversion_lx &
28346 L4_MABX_P.Operator_BitMask_cs;
28347
28348 /* DataTypeConversion: '<S1046>/DataType' */
28349 q0 = L4_MABX_B.Operator;
28350 if (q0 > 255U) {
28351 q0 = 255U;
28352 }
28353
28354 L4_MABX_B.DataType_bii = (uint8_T)q0;
28355
28356 /* End of DataTypeConversion: '<S1046>/DataType' */
28357
28358 /* DataTypeConversion: '<S1041>/Data Type Conversion3' */
28359 L4_MABX_B.DataTypeConversion3_li = L4_MABX_B.DataType_bii;
28360
28361 /* DataTypeConversion: '<S1043>/Data Type Conversion' */
28362 L4_MABX_B.DataTypeConversion_m = L4_MABX_B.DataTypeConversion3_li;
28363
28364 /* S-Function (sfix_bitop): '<S1047>/Operator' */
28365 L4_MABX_B.Operator_e = L4_MABX_B.DataTypeConversion_lx &
28366 L4_MABX_P.Operator_BitMask_kd;
28367
28368 /* DataTypeConversion: '<S1047>/DataType' */
28369 q0 = L4_MABX_B.Operator_e;
28370 if (q0 > 65535U) {
28371 q0 = 65535U;
28372 }
28373
28374 L4_MABX_B.DataType_hs = (uint16_T)q0;
28375
28376 /* End of DataTypeConversion: '<S1047>/DataType' */
28377
28378 /* ArithShift: '<S1041>/Shift_Arithmetic ' */
28379 L4_MABX_B.Shift_Arithmetic_g = (uint16_T)((uint32_T)L4_MABX_B.DataType_hs >> 8);
28380
28381 /* DataTypeConversion: '<S1041>/Data Type Conversion1' */
28382 tmp = L4_MABX_B.Shift_Arithmetic_g;
28383 if (tmp > 255) {
28384 tmp = 255U;
28385 }
28386
28387 L4_MABX_B.DataTypeConversion1_jk = (uint8_T)tmp;
28388
28389 /* End of DataTypeConversion: '<S1041>/Data Type Conversion1' */
28390
28391 /* DataTypeConversion: '<S1043>/Data Type Conversion1' */
28392 L4_MABX_B.DataTypeConversion1_c = L4_MABX_B.DataTypeConversion1_jk;
28393
28394 /* S-Function (sfix_bitop): '<S1048>/Operator' */
28395 L4_MABX_B.Operator_n = L4_MABX_B.DataTypeConversion_lx &
28396 L4_MABX_P.Operator_BitMask_nkr;
28397
28398 /* DataTypeConversion: '<S1048>/DataType' */
28399 L4_MABX_B.DataType_lp = L4_MABX_B.Operator_n;
28400
28401 /* ArithShift: '<S1041>/Shift_Arithmetic 1' */
28402 L4_MABX_B.Shift_Arithmetic1_c = L4_MABX_B.DataType_lp >> 16;
28403
28404 /* DataTypeConversion: '<S1041>/Data Type Conversion2' */
28405 q0 = L4_MABX_B.Shift_Arithmetic1_c;
28406 if (q0 > 255U) {
28407 q0 = 255U;
28408 }
28409
28410 L4_MABX_B.DataTypeConversion2_f5 = (uint8_T)q0;
28411
28412 /* End of DataTypeConversion: '<S1041>/Data Type Conversion2' */
28413
28414 /* DataTypeConversion: '<S1043>/Data Type Conversion2' */
28415 L4_MABX_B.DataTypeConversion2_e = L4_MABX_B.DataTypeConversion2_f5;
28416
28417 /* Outputs for Enabled SubSystem: '<S1043>/RQST_13_E4' incorporates:
28418 * EnablePort: '<S1045>/Enable'
28419 */
28420 if (L4_MABX_B.DataType_eq) {
28421 /* S-Function (rti_commonblock): '<S1045>/S-Function1' */
28422 /* This comment workarounds a code generation problem */
28423
28424 /* dSPACE RTICAN TX Message Block: "RQST_13_E4" Id:417993700 */
28425 {
28426 UInt32 CAN_Msg[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
28427
28428 Float32 delayTime = 0.0;
28429
28430 /* ... Read status and timestamp info (previous message) */
28431 can_tp1_msg_read(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]);
28432
28433 /* Convert timestamp */
28434 if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->processed) {
28435 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp =
28436 rtk_dsts_time_to_simtime_convert
28437 (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp);
28438 }
28439
28440 /* Messages with timestamp zero have been received in pause/stop state
28441 and must not be handled.
28442 */
28443 if (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp > 0.0) {
28444 L4_MABX_B.SFunction1_o1_jk = (real_T)
28445 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->processed;
28446 L4_MABX_B.SFunction1_o2_d = (real_T)
28447 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->timestamp;
28448 L4_MABX_B.SFunction1_o3_f = (real_T)
28449 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->deltatime;
28450 L4_MABX_B.SFunction1_o4_h = (real_T)
28451 can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4]->delaytime;
28452 }
28453
28454 /* ... Encode Simulink signals of TX and RM blocks*/
28455 {
28456 rtican_Signal_t CAN_Sgn;
28457
28458 /* ...... "byte1" (0|8, standard signal, unsigned int, little endian) */
28459 /* Add or substract 0.5 in order to round to nearest integer */
28460 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion_m ) + 0.5);
28461 CAN_Sgn.UnsignedSgn &= 0x000000FF;
28462 CAN_Msg[0] |= CAN_Sgn.SgnBytes.Byte0;
28463
28464 /* ...... "byte2" (8|8, standard signal, unsigned int, little endian) */
28465 /* Add or substract 0.5 in order to round to nearest integer */
28466 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion1_c ) +
28467 0.5);
28468 CAN_Sgn.UnsignedSgn &= 0x000000FF;
28469 CAN_Msg[1] |= CAN_Sgn.SgnBytes.Byte0;
28470
28471 /* ...... "byte3" (16|8, standard signal, unsigned int, little endian) */
28472 /* Add or substract 0.5 in order to round to nearest integer */
28473 CAN_Sgn.UnsignedSgn = (UInt32) (( L4_MABX_B.DataTypeConversion2_e ) +
28474 0.5);
28475 CAN_Sgn.UnsignedSgn &= 0x000000FF;
28476 CAN_Msg[2] |= CAN_Sgn.SgnBytes.Byte0;
28477 }
28478
28479 /* ... Write the data to the CAN microcontroller and trigger the sending of the message */
28480 can_tp1_msg_send(can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4], 8,
28481 &(CAN_Msg[0]), delayTime);
28482 }
28483 }
28484
28485 /* End of Outputs for SubSystem: '<S1043>/RQST_13_E4' */
28486
28487 /* RelationalOperator: '<S1051>/Operator' */
28488 L4_MABX_B.Operator_kh = (L4_MABX_B.Switch1_a == L4_MABX_B.Width);
28489
28490 /* End of Outputs for SubSystem: '<S849>/CAN_TX_5000ms' */
28491 /* user code (Output function Trailer for TID7) */
28492
28493 /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */
28494 /* EventChannel: 0 */
28495 if (tid == 0) {
28496 DSXCP_service(0);
28497 }
28498
28499 /* If subsystem generates rate grouping Output functions,
28500 * when tid is used in Output function for one rate,
28501 * all Output functions include tid as a local variable.
28502 * As result, some Output functions may have unused tid.
28503 */
28504 UNUSED_PARAMETER(tid);
28505}
28506
28507/* Model update function for TID7 */
28508void L4_MABX_update7(void) /* Sample time: [5.0s, 0.0s] */
28509{
28510 /* Update for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */
28511
28512 /* Update for UnitDelay: '<S1049>/Unit_Delay' */
28513 L4_MABX_DW.Unit_Delay_DSTATE_ek = L4_MABX_B.Operator_kh;
28514
28515 /* Update for UnitDelay: '<S1050>/Unit Delay' */
28516 L4_MABX_DW.UnitDelay_DSTATE_h = L4_MABX_B.Switch1_a;
28517
28518 /* End of Update for SubSystem: '<S849>/CAN_TX_5000ms' */
28519}
28520
28521/* Model output function for TID8 */
28522void L4_MABX_output8(void) /* Sample time: [10.0s, 0.0s] */
28523{
28524 int_T tid = 8;
28525
28526 /* user code (Output function Trailer for TID8) */
28527
28528 /* XCP Data Capture block: <Root>/RTIEthXCP Data Capture */
28529 /* EventChannel: 0 */
28530 if (tid == 0) {
28531 DSXCP_service(0);
28532 }
28533
28534 /* If subsystem generates rate grouping Output functions,
28535 * when tid is used in Output function for one rate,
28536 * all Output functions include tid as a local variable.
28537 * As result, some Output functions may have unused tid.
28538 */
28539 UNUSED_PARAMETER(tid);
28540}
28541
28542/* Model update function for TID8 */
28543void L4_MABX_update8(void) /* Sample time: [10.0s, 0.0s] */
28544{
28545 /* (no update code required) */
28546}
28547
28548/* Model output wrapper function for compatibility with a static main program */
28549void L4_MABX_output(int_T tid)
28550{
28551 switch (tid) {
28552 case 0 :
28553 L4_MABX_output0();
28554 break;
28555
28556 case 1 :
28557 L4_MABX_output1();
28558 break;
28559
28560 case 2 :
28561 L4_MABX_output2();
28562 break;
28563
28564 case 3 :
28565 L4_MABX_output3();
28566 break;
28567
28568 case 4 :
28569 L4_MABX_output4();
28570 break;
28571
28572 case 5 :
28573 L4_MABX_output5();
28574 break;
28575
28576 case 6 :
28577 L4_MABX_output6();
28578 break;
28579
28580 case 7 :
28581 L4_MABX_output7();
28582 break;
28583
28584 case 8 :
28585 L4_MABX_output8();
28586 break;
28587
28588 default :
28589 break;
28590 }
28591}
28592
28593/* Model update wrapper function for compatibility with a static main program */
28594void L4_MABX_update(int_T tid)
28595{
28596 switch (tid) {
28597 case 0 :
28598 L4_MABX_update0();
28599 break;
28600
28601 case 1 :
28602 L4_MABX_update1();
28603 break;
28604
28605 case 2 :
28606 L4_MABX_update2();
28607 break;
28608
28609 case 3 :
28610 L4_MABX_update3();
28611 break;
28612
28613 case 4 :
28614 L4_MABX_update4();
28615 break;
28616
28617 case 5 :
28618 L4_MABX_update5();
28619 break;
28620
28621 case 6 :
28622 L4_MABX_update6();
28623 break;
28624
28625 case 7 :
28626 L4_MABX_update7();
28627 break;
28628
28629 case 8 :
28630 L4_MABX_update8();
28631 break;
28632
28633 default :
28634 break;
28635 }
28636}
28637
28638/* Model initialize function */
28639void L4_MABX_initialize(void)
28640{
28641 /* Registration code */
28642
28643 /* initialize non-finites */
28644 rt_InitInfAndNaN(sizeof(real_T));
28645
28646 /* non-finite (run-time) assignments */
28647 L4_MABX_P.Saturation_UpperSat = rtInf;
28648 L4_MABX_P.Saturation_UpperSat_o = rtInf;
28649 L4_MABX_P.Saturation_UpperSat_f = rtInf;
28650 L4_MABX_P.Saturation1_UpperSat_j = rtInf;
28651 L4_MABX_P.Saturation_UpperSat_l = rtInf;
28652 L4_MABX_P.Saturation_UpperSat_o1 = rtInf;
28653 L4_MABX_P.Saturation_UpperSat_d = rtInf;
28654 L4_MABX_P.Saturation_UpperSat_ok = rtInf;
28655 L4_MABX_P.Saturation_UpperSat_j = rtInf;
28656 L4_MABX_P.Saturation_UpperSat_g = rtInf;
28657 L4_MABX_P.Calculate_D_term_h.Saturation_UpperSat = rtInf;
28658 L4_MABX_P.Calculate_D_term_p.Saturation_UpperSat = rtInf;
28659 L4_MABX_P.Calculate_D_term.Saturation_UpperSat = rtInf;
28660
28661 /* initialize real-time model */
28662 (void) memset((void *)L4_MABX_M, 0,
28663 sizeof(RT_MODEL_L4_MABX_T));
28664 (L4_MABX_M)->Timing.TaskCounters.cLimit[0] = 1;
28665 (L4_MABX_M)->Timing.TaskCounters.cLimit[1] = 2;
28666 (L4_MABX_M)->Timing.TaskCounters.cLimit[2] = 5;
28667 (L4_MABX_M)->Timing.TaskCounters.cLimit[3] = 10;
28668 (L4_MABX_M)->Timing.TaskCounters.cLimit[4] = 25;
28669 (L4_MABX_M)->Timing.TaskCounters.cLimit[5] = 50;
28670 (L4_MABX_M)->Timing.TaskCounters.cLimit[6] = 100;
28671 (L4_MABX_M)->Timing.TaskCounters.cLimit[7] = 500;
28672 (L4_MABX_M)->Timing.TaskCounters.cLimit[8] = 1000;
28673 rtsiSetSolverName(&L4_MABX_M->solverInfo,"FixedStepDiscrete");
28674 L4_MABX_M->solverInfoPtr = (&L4_MABX_M->solverInfo);
28675
28676 /* Initialize timing info */
28677 {
28678 int_T *mdlTsMap = L4_MABX_M->Timing.sampleTimeTaskIDArray;
28679 int_T i;
28680 for (i = 0; i < 9; i++) {
28681 mdlTsMap[i] = i;
28682 }
28683
28684 L4_MABX_M->Timing.sampleTimeTaskIDPtr = (&mdlTsMap[0]);
28685 L4_MABX_M->Timing.sampleTimes = (&L4_MABX_M->Timing.sampleTimesArray[0]);
28686 L4_MABX_M->Timing.offsetTimes = (&L4_MABX_M->Timing.offsetTimesArray[0]);
28687
28688 /* task periods */
28689 L4_MABX_M->Timing.sampleTimes[0] = (0.01);
28690 L4_MABX_M->Timing.sampleTimes[1] = (0.02);
28691 L4_MABX_M->Timing.sampleTimes[2] = (0.05);
28692 L4_MABX_M->Timing.sampleTimes[3] = (0.1);
28693 L4_MABX_M->Timing.sampleTimes[4] = (0.25);
28694 L4_MABX_M->Timing.sampleTimes[5] = (0.5);
28695 L4_MABX_M->Timing.sampleTimes[6] = (1.0);
28696 L4_MABX_M->Timing.sampleTimes[7] = (5.0);
28697 L4_MABX_M->Timing.sampleTimes[8] = (10.0);
28698
28699 /* task offsets */
28700 L4_MABX_M->Timing.offsetTimes[0] = (0.0);
28701 L4_MABX_M->Timing.offsetTimes[1] = (0.0);
28702 L4_MABX_M->Timing.offsetTimes[2] = (0.0);
28703 L4_MABX_M->Timing.offsetTimes[3] = (0.0);
28704 L4_MABX_M->Timing.offsetTimes[4] = (0.0);
28705 L4_MABX_M->Timing.offsetTimes[5] = (0.0);
28706 L4_MABX_M->Timing.offsetTimes[6] = (0.0);
28707 L4_MABX_M->Timing.offsetTimes[7] = (0.0);
28708 L4_MABX_M->Timing.offsetTimes[8] = (0.0);
28709 }
28710
28711 rtmSetTPtr(L4_MABX_M, &L4_MABX_M->Timing.tArray[0]);
28712
28713 {
28714 int_T *mdlSampleHits = L4_MABX_M->Timing.sampleHitArray;
28715 int_T *mdlPerTaskSampleHits = L4_MABX_M->Timing.perTaskSampleHitsArray;
28716 L4_MABX_M->Timing.perTaskSampleHits = (&mdlPerTaskSampleHits[0]);
28717 mdlSampleHits[0] = 1;
28718 L4_MABX_M->Timing.sampleHits = (&mdlSampleHits[0]);
28719 }
28720
28721 rtmSetTFinal(L4_MABX_M, -1);
28722 L4_MABX_M->Timing.stepSize0 = 0.01;
28723 L4_MABX_M->Timing.stepSize9 = 2.3283064365386963E-10;
28724 L4_MABX_M->Timing.stepSize10 = 2.3283064365386963E-10;
28725 L4_MABX_M->Timing.stepSize11 = 2.3283064365386963E-10;
28726 L4_MABX_M->solverInfoPtr = (&L4_MABX_M->solverInfo);
28727 L4_MABX_M->Timing.stepSize = (0.01);
28728 rtsiSetFixedStepSize(&L4_MABX_M->solverInfo, 0.01);
28729 rtsiSetSolverMode(&L4_MABX_M->solverInfo, SOLVER_MODE_MULTITASKING);
28730
28731 /* block I/O */
28732 (void) memset(((void *) &L4_MABX_B), 0,
28733 sizeof(B_L4_MABX_T));
28734
28735 {
28736 L4_MABX_B.EPBPCMInhibitStatusFeedback = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE;
28737 L4_MABX_B.EPBPCMInhibitStatusFeedback_f = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE;
28738 L4_MABX_B.EPBPCMManualStatusFeedback = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE;
28739 L4_MABX_B.EPBPCMManualStatusFeedback_m = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE;
28740 L4_MABX_B.EPBPCMInhibitStatusFeedback_m = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE;
28741 L4_MABX_B.EPBPCMInhibitStatusFeedback_i = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE;
28742 L4_MABX_B.EPBPCMManualStatusFeedback_d = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE;
28743 L4_MABX_B.EPBPCMManualStatusFeedback_f = ENUM_XPR_FEEDBACK_T_NOT_AVAILABLE;
28744 L4_MABX_B.XPRErrorState = ENUM_XPR_ERROR_STATE_T_XPR_OK;
28745 L4_MABX_B.XPRErrorState_d = ENUM_XPR_ERROR_STATE_T_XPR_OK;
28746 L4_MABX_B.XPRControlMode = ENUM_XPR_CONTROL_MODE_T_NO_BRAKE_DEMAND;
28747 L4_MABX_B.XPRControlMode_d = ENUM_XPR_CONTROL_MODE_T_NO_BRAKE_DEMAND;
28748 L4_MABX_B.XBRPassThroughActive = ENUM_XBR_PASS_THROUGH_ACTIVE_T_NOT_ACTIVE;
28749 L4_MABX_B.DataTypeConversion_lr = ENUM_SWITCH_T_OFF;
28750 L4_MABX_B.DataTypeConversion1_lu = ENUM_SWITCH_T_OFF;
28751 L4_MABX_B.Pedal_2_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE;
28752 L4_MABX_B.Pedal_1_pwm_health_state = ENUM_SIGNAL_HEALTH_T_FAULT_INACTIVE;
28753 L4_MABX_B.BrkPedArbBrakeSwitch = ENUM_J1939_SWITCH_T_OFF;
28754 L4_MABX_B.BrkPedArbBrakeSwitch_c = ENUM_J1939_SWITCH_T_OFF;
28755 L4_MABX_B.DataTypeConversion1_cy = ENUM_J1939_SWITCH_T_OFF;
28756 L4_MABX_B.DataTypeConversion3_l = ENUM_J1939_SWITCH_T_OFF;
28757 L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_NOT_AVAILABLE;
28758 L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_NOT_AVAILABLE;
28759 L4_MABX_B.If_Then_Else_dq.XBRPriority = ENUM_XBR_PRIORITY_T_HIGHEST_PRIORITY;
28760 L4_MABX_B.If_Then_Else_dq.XBRPassThroughActive =
28761 ENUM_XBR_PASS_THROUGH_ACTIVE_T_NOT_ACTIVE;
28762 L4_MABX_B.If_Then_Else_dq.XBREnduranceBrakeIntegrationMod =
28763 ENUM_XBR_EBI_MODE_T_NO_EBI_ALLOWED;
28764 L4_MABX_B.If_Then_Else_dq.XBRControlMode =
28765 ENUM_XBR_CONTROL_MODE_T_OVERRIDE_DISABLED;
28766 }
28767
28768 /* exported global signals */
28769 GLB_Absolute_Timestamp = 0.0;
28770 ReAX_ActualHandwheelPos = 0.0;
28771 EthernetLinkStatus = 0.0;
28772 CurrentAzimuth_rad = 0.0;
28773 TargetAzimuth_rad = 0.0;
28774 TargetVelocity_kph = 0.0;
28775 Curvature = 0.0;
28776 CrosstrackError = 0.0;
28777 CurrentVelocity_kph = 0.0;
28778 GPS_X = 0.0;
28779 GPS_Y = 0.0;
28780 GPS_Time = 0.0;
28781 ReAX_EchoedSteerWheelPos = 0.0;
28782 SteerWheelAngle = 0.0;
28783 YawRate = 0.0;
28784 SPN1810_LongitudinalAcceleration = 0.0;
28785 WheelBasedVehicleSpeed = 0.0;
28786 BrakeSwitch = 0.0;
28787 Lateral_Control_Rate_Limit = 0.0;
28788 Lateral_Control_Output = 0.0;
28789 Lateral_Control_Rate_Limiter_Output = 0.0;
28790 SteerCommandDeg = 0.0;
28791 DesiredSteeringAngle = 0.0;
28792 Lateral_Control_Heading_Error = 0.0;
28793 DIAG_CAN1_Count_Stuff_Errors = 0U;
28794 DIAG_CAN1_Count_Format_Errors = 0U;
28795 DIAG_CAN1_Count_Ack_Errors = 0U;
28796 DIAG_CAN1_Count_Bit0_Errors = 0U;
28797 DIAG_CAN1_Count_Bit1_Errors = 0U;
28798 DIAG_CAN1_Count_CRC_Errors = 0U;
28799 DIAG_CAN1_Count_RX_Lost = 0U;
28800 DIAG_CAN1_Count_RX_OK = 0U;
28801 DIAG_CAN1_Count_TX_OK = 0U;
28802 DIAG_CAN5_Count_Stuff_Errors = 0U;
28803 DIAG_CAN5_Count_Format_Errors = 0U;
28804 DIAG_CAN5_Count_Ack_Errors = 0U;
28805 DIAG_CAN5_Count_Bit0_Errors = 0U;
28806 DIAG_CAN5_Count_Bit1_Errors = 0U;
28807 DIAG_CAN5_Count_CRC_Errors = 0U;
28808 DIAG_CAN5_Count_RX_Lost = 0U;
28809 DIAG_CAN5_Count_RX_OK = 0U;
28810 DIAG_CAN5_Count_TX_OK = 0U;
28811 DIAG_CAN6_Count_Stuff_Errors = 0U;
28812 DIAG_CAN6_Count_Format_Errors = 0U;
28813 DIAG_CAN6_Count_Ack_Errors = 0U;
28814 DIAG_CAN6_Count_Bit0_Errors = 0U;
28815 DIAG_CAN6_Count_Bit1_Errors = 0U;
28816 DIAG_CAN6_Count_CRC_Errors = 0U;
28817 DIAG_CAN6_Count_RX_Lost = 0U;
28818 DIAG_CAN6_Count_RX_OK = 0U;
28819 DIAG_CAN6_Count_TX_OK = 0U;
28820 DIAG_CAN3_Count_Stuff_Errors = 0U;
28821 DIAG_CAN3_Count_Format_Errors = 0U;
28822 DIAG_CAN3_Count_Ack_Errors = 0U;
28823 DIAG_CAN3_Count_Bit0_Errors = 0U;
28824 DIAG_CAN3_Count_Bit1_Errors = 0U;
28825 DIAG_CAN3_Count_CRC_Errors = 0U;
28826 DIAG_CAN3_Count_RX_Lost = 0U;
28827 DIAG_CAN3_Count_RX_OK = 0U;
28828 DIAG_CAN3_Count_TX_OK = 0U;
28829 DIAG_CAN4_Count_Stuff_Errors = 0U;
28830 DIAG_CAN4_Count_Format_Errors = 0U;
28831 DIAG_CAN4_Count_Ack_Errors = 0U;
28832 DIAG_CAN4_Count_Bit0_Errors = 0U;
28833 DIAG_CAN4_Count_Bit1_Errors = 0U;
28834 DIAG_CAN4_Count_CRC_Errors = 0U;
28835 DIAG_CAN4_Count_RX_Lost = 0U;
28836 DIAG_CAN4_Count_RX_OK = 0U;
28837 DIAG_CAN4_Count_TX_OK = 0U;
28838 DIAG_CAN2_Count_Stuff_Errors = 0U;
28839 DIAG_CAN2_Count_Format_Errors = 0U;
28840 DIAG_CAN2_Count_Ack_Errors = 0U;
28841 DIAG_CAN2_Count_Bit0_Errors = 0U;
28842 DIAG_CAN2_Count_Bit1_Errors = 0U;
28843 DIAG_CAN2_Count_CRC_Errors = 0U;
28844 DIAG_CAN2_Count_RX_Lost = 0U;
28845 DIAG_CAN2_Count_RX_OK = 0U;
28846 DIAG_CAN2_Count_TX_OK = 0U;
28847 REAX_Handwheel_Torque = 0.0F;
28848 REAX_Handwheel_Velocity = 0.0F;
28849 REAX_Pull_Compensation = 0.0F;
28850 DIAG_CAN1_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE;
28851 DIAG_CAN5_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE;
28852 DIAG_CAN6_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE;
28853 DIAG_CAN3_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE;
28854 DIAG_CAN4_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE;
28855 DIAG_CAN2_Status = ENUM_CAN_STATUS_DIAG_T_ACTIVE;
28856 SupervisorMode = 0U;
28857 REAX_Current_Mode = 0U;
28858 REAX_Req_Mode = 0U;
28859 REAX_Status = 0U;
28860
28861 {
28862 int32_T i;
28863 for (i = 0; i < 100; i++) {
28864 GLB_SWVERSION_CPV_[i] = ((uint8_T)0U);
28865 }
28866 }
28867
28868 MABX_Mode = 0U;
28869 EStop = false;
28870 EnableSw = false;
28871 EngagePB = false;
28872 BrakeSW = false;
28873 MABX_Heartbeat = false;
28874 Heartbeat_Ok = false;
28875 RTMapsOk = false;
28876 LogEventPB = false;
28877 AutonomousOutputEnabled = false;
28878 RateLimiterActive = false;
28879 Pedal_pwm_position = 0.0;
28880
28881 /* states (dwork) */
28882 (void) memset((void *)&L4_MABX_DW, 0,
28883 sizeof(DW_L4_MABX_T));
28884
28885 /* child S-Function registration */
28886 {
28887 RTWSfcnInfo *sfcnInfo = &L4_MABX_M->NonInlinedSFcns.sfcnInfo;
28888 L4_MABX_M->sfcnInfo = (sfcnInfo);
28889 rtssSetErrorStatusPtr(sfcnInfo, (&rtmGetErrorStatus(L4_MABX_M)));
28890 rtssSetNumRootSampTimesPtr(sfcnInfo, &L4_MABX_M->Sizes.numSampTimes);
28891 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[0] = &(rtmGetTPtr(L4_MABX_M)[0]);
28892 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[1] = &(rtmGetTPtr(L4_MABX_M)[1]);
28893 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[2] = &(rtmGetTPtr(L4_MABX_M)[2]);
28894 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[3] = &(rtmGetTPtr(L4_MABX_M)[3]);
28895 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[4] = &(rtmGetTPtr(L4_MABX_M)[4]);
28896 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[5] = &(rtmGetTPtr(L4_MABX_M)[5]);
28897 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[6] = &(rtmGetTPtr(L4_MABX_M)[6]);
28898 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[7] = &(rtmGetTPtr(L4_MABX_M)[7]);
28899 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[8] = &(rtmGetTPtr(L4_MABX_M)[8]);
28900 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[9] = &(rtmGetTPtr(L4_MABX_M)[9]);
28901 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[10] = &(rtmGetTPtr(L4_MABX_M)[10]);
28902 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[11] = &(rtmGetTPtr(L4_MABX_M)[11]);
28903 L4_MABX_M->NonInlinedSFcns.taskTimePtrs[12] = &(rtmGetTPtr(L4_MABX_M)[12]);
28904 rtssSetTPtrPtr(sfcnInfo,L4_MABX_M->NonInlinedSFcns.taskTimePtrs);
28905 rtssSetTStartPtr(sfcnInfo, &rtmGetTStart(L4_MABX_M));
28906 rtssSetTFinalPtr(sfcnInfo, &rtmGetTFinal(L4_MABX_M));
28907 rtssSetTimeOfLastOutputPtr(sfcnInfo, &rtmGetTimeOfLastOutput(L4_MABX_M));
28908 rtssSetStepSizePtr(sfcnInfo, &L4_MABX_M->Timing.stepSize);
28909 rtssSetStopRequestedPtr(sfcnInfo, &rtmGetStopRequested(L4_MABX_M));
28910 rtssSetDerivCacheNeedsResetPtr(sfcnInfo, &L4_MABX_M->derivCacheNeedsReset);
28911 rtssSetZCCacheNeedsResetPtr(sfcnInfo, &L4_MABX_M->zCCacheNeedsReset);
28912 rtssSetContTimeOutputInconsistentWithStateAtMajorStepPtr(sfcnInfo,
28913 &L4_MABX_M->CTOutputIncnstWithState);
28914 rtssSetSampleHitsPtr(sfcnInfo, &L4_MABX_M->Timing.sampleHits);
28915 rtssSetPerTaskSampleHitsPtr(sfcnInfo, &L4_MABX_M->Timing.perTaskSampleHits);
28916 rtssSetSimModePtr(sfcnInfo, &L4_MABX_M->simMode);
28917 rtssSetSolverInfoPtr(sfcnInfo, &L4_MABX_M->solverInfoPtr);
28918 }
28919
28920 L4_MABX_M->Sizes.numSFcns = (5);
28921
28922 /* register each child */
28923 {
28924 (void) memset((void *)&L4_MABX_M->NonInlinedSFcns.childSFunctions[0], 0,
28925 5*sizeof(SimStruct));
28926 L4_MABX_M->childSfunctions = (&L4_MABX_M->
28927 NonInlinedSFcns.childSFunctionPtrs[0]);
28928
28929 {
28930 int_T i;
28931 for (i = 0; i < 5; i++) {
28932 L4_MABX_M->childSfunctions[i] =
28933 (&L4_MABX_M->NonInlinedSFcns.childSFunctions[i]);
28934 }
28935 }
28936
28937 /* Level2 S-Function Block: L4_MABX/<S409>/dsa_tcpip_bkg_sfcn (dsa_tcpip_bkg_sfcn) */
28938 {
28939 SimStruct *rts = L4_MABX_M->childSfunctions[0];
28940
28941 /* timing info */
28942 time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn0.sfcnPeriod;
28943 time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn0.sfcnOffset;
28944 int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn0.sfcnTsMap;
28945 (void) memset((void*)sfcnPeriod, 0,
28946 sizeof(time_T)*1);
28947 (void) memset((void*)sfcnOffset, 0,
28948 sizeof(time_T)*1);
28949 ssSetSampleTimePtr(rts, &sfcnPeriod[0]);
28950 ssSetOffsetTimePtr(rts, &sfcnOffset[0]);
28951 ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap);
28952
28953 {
28954 ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[0]);
28955 }
28956
28957 _ssSetBlkInfo2PortInfo2Ptr(rts,
28958 &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[0]);
28959
28960 /* Set up the mdlInfo pointer */
28961 ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo);
28962
28963 /* Allocate memory of model methods 2 */
28964 {
28965 ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[0]);
28966 }
28967
28968 /* Allocate memory of model methods 3 */
28969 {
28970 ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[0]);
28971 }
28972
28973 /* Allocate memory of model methods 4 */
28974 {
28975 ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[0]);
28976 }
28977
28978 /* Allocate memory for states auxilliary information */
28979 {
28980 ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[0]);
28981 ssSetPeriodicStatesInfo(rts,
28982 &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[0]);
28983 }
28984
28985 /* path info */
28986 ssSetModelName(rts, "dsa_tcpip_bkg_sfcn");
28987 ssSetPath(rts,
28988 "L4_MABX/ETHERNET/TCPIP_Setup/Background_Task/dsa_tcpip_bkg_sfcn");
28989 ssSetRTModel(rts,L4_MABX_M);
28990 ssSetParentSS(rts, (NULL));
28991 ssSetRootSS(rts, rts);
28992 ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2);
28993
28994 /* work vectors */
28995 ssSetIWork(rts, (int_T *) &L4_MABX_DW.dsa_tcpip_bkg_sfcn_IWORK);
28996
28997 {
28998 struct _ssDWorkRecord *dWorkRecord = (struct _ssDWorkRecord *)
28999 &L4_MABX_M->NonInlinedSFcns.Sfcn0.dWork;
29000 struct _ssDWorkAuxRecord *dWorkAuxRecord = (struct _ssDWorkAuxRecord *)
29001 &L4_MABX_M->NonInlinedSFcns.Sfcn0.dWorkAux;
29002 ssSetSFcnDWork(rts, dWorkRecord);
29003 ssSetSFcnDWorkAux(rts, dWorkAuxRecord);
29004 _ssSetNumDWork(rts, 1);
29005
29006 /* IWORK */
29007 ssSetDWorkWidth(rts, 0, 1);
29008 ssSetDWorkDataType(rts, 0,SS_INTEGER);
29009 ssSetDWorkComplexSignal(rts, 0, 0);
29010 ssSetDWork(rts, 0, &L4_MABX_DW.dsa_tcpip_bkg_sfcn_IWORK);
29011 }
29012
29013 /* registration */
29014 dsa_tcpip_bkg_sfcn(rts);
29015 sfcnInitializeSizes(rts);
29016 sfcnInitializeSampleTimes(rts);
29017
29018 /* adjust sample time */
29019 ssSetSampleTime(rts, 0, -1.0);
29020 ssSetOffsetTime(rts, 0, -2.0);
29021 sfcnTsMap[0] = 9;
29022
29023 /* set compiled values of dynamic vector attributes */
29024 ssSetNumNonsampledZCs(rts, 0);
29025
29026 /* Update connectivity flags for each port */
29027 /* Update the BufferDstPort flags for each input port */
29028 }
29029
29030 /* Level2 S-Function Block: L4_MABX/<S410>/dsa_tcpip_irq_l2_sfcn (dsa_tcpip_irq_l2_sfcn) */
29031 {
29032 SimStruct *rts = L4_MABX_M->childSfunctions[1];
29033
29034 /* timing info */
29035 time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn1.sfcnPeriod;
29036 time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn1.sfcnOffset;
29037 int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn1.sfcnTsMap;
29038 (void) memset((void*)sfcnPeriod, 0,
29039 sizeof(time_T)*1);
29040 (void) memset((void*)sfcnOffset, 0,
29041 sizeof(time_T)*1);
29042 ssSetSampleTimePtr(rts, &sfcnPeriod[0]);
29043 ssSetOffsetTimePtr(rts, &sfcnOffset[0]);
29044 ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap);
29045
29046 {
29047 ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[1]);
29048 }
29049
29050 _ssSetBlkInfo2PortInfo2Ptr(rts,
29051 &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[1]);
29052
29053 /* Set up the mdlInfo pointer */
29054 ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo);
29055
29056 /* Allocate memory of model methods 2 */
29057 {
29058 ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[1]);
29059 }
29060
29061 /* Allocate memory of model methods 3 */
29062 {
29063 ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[1]);
29064 }
29065
29066 /* Allocate memory of model methods 4 */
29067 {
29068 ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[1]);
29069 }
29070
29071 /* Allocate memory for states auxilliary information */
29072 {
29073 ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[1]);
29074 ssSetPeriodicStatesInfo(rts,
29075 &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[1]);
29076 }
29077
29078 /* path info */
29079 ssSetModelName(rts, "dsa_tcpip_irq_l2_sfcn");
29080 ssSetPath(rts,
29081 "L4_MABX/ETHERNET/TCPIP_Setup/IRQ_Level_2_SW_INT/dsa_tcpip_irq_l2_sfcn");
29082 ssSetRTModel(rts,L4_MABX_M);
29083 ssSetParentSS(rts, (NULL));
29084 ssSetRootSS(rts, rts);
29085 ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2);
29086
29087 /* registration */
29088 dsa_tcpip_irq_l2_sfcn(rts);
29089 sfcnInitializeSizes(rts);
29090 sfcnInitializeSampleTimes(rts);
29091
29092 /* adjust sample time */
29093 ssSetSampleTime(rts, 0, -1.0);
29094 ssSetOffsetTime(rts, 0, -3.0);
29095 sfcnTsMap[0] = 10;
29096
29097 /* set compiled values of dynamic vector attributes */
29098 ssSetNumNonsampledZCs(rts, 0);
29099
29100 /* Update connectivity flags for each port */
29101 /* Update the BufferDstPort flags for each input port */
29102 }
29103
29104 /* Level2 S-Function Block: L4_MABX/<S411>/dsa_tcpip_irq_l1_sfcn (dsa_tcpip_irq_l1_sfcn) */
29105 {
29106 SimStruct *rts = L4_MABX_M->childSfunctions[2];
29107
29108 /* timing info */
29109 time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn2.sfcnPeriod;
29110 time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn2.sfcnOffset;
29111 int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn2.sfcnTsMap;
29112 (void) memset((void*)sfcnPeriod, 0,
29113 sizeof(time_T)*1);
29114 (void) memset((void*)sfcnOffset, 0,
29115 sizeof(time_T)*1);
29116 ssSetSampleTimePtr(rts, &sfcnPeriod[0]);
29117 ssSetOffsetTimePtr(rts, &sfcnOffset[0]);
29118 ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap);
29119
29120 {
29121 ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[2]);
29122 }
29123
29124 _ssSetBlkInfo2PortInfo2Ptr(rts,
29125 &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[2]);
29126
29127 /* Set up the mdlInfo pointer */
29128 ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo);
29129
29130 /* Allocate memory of model methods 2 */
29131 {
29132 ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[2]);
29133 }
29134
29135 /* Allocate memory of model methods 3 */
29136 {
29137 ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[2]);
29138 }
29139
29140 /* Allocate memory of model methods 4 */
29141 {
29142 ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[2]);
29143 }
29144
29145 /* Allocate memory for states auxilliary information */
29146 {
29147 ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[2]);
29148 ssSetPeriodicStatesInfo(rts,
29149 &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[2]);
29150 }
29151
29152 /* outputs */
29153 {
29154 ssSetPortInfoForOutputs(rts,
29155 &L4_MABX_M->NonInlinedSFcns.Sfcn2.outputPortInfo[0]);
29156 _ssSetNumOutputPorts(rts, 1);
29157 _ssSetPortInfo2ForOutputUnits(rts,
29158 &L4_MABX_M->NonInlinedSFcns.Sfcn2.outputPortUnits[0]);
29159 ssSetOutputPortUnit(rts, 0, 0);
29160 _ssSetPortInfo2ForOutputCoSimAttribute(rts,
29161 &L4_MABX_M->NonInlinedSFcns.Sfcn2.outputPortCoSimAttribute[0]);
29162 ssSetOutputPortIsContinuousQuantity(rts, 0, 0);
29163
29164 /* port 0 */
29165 {
29166 _ssSetOutputPortNumDimensions(rts, 0, 1);
29167 ssSetOutputPortWidth(rts, 0, 1);
29168 ssSetOutputPortSignal(rts, 0, (NULL));
29169 }
29170 }
29171
29172 /* path info */
29173 ssSetModelName(rts, "dsa_tcpip_irq_l1_sfcn");
29174 ssSetPath(rts,
29175 "L4_MABX/ETHERNET/TCPIP_Setup/Interrupt_Task/dsa_tcpip_irq_l1_sfcn");
29176 ssSetRTModel(rts,L4_MABX_M);
29177 ssSetParentSS(rts, (NULL));
29178 ssSetRootSS(rts, rts);
29179 ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2);
29180
29181 /* register function-calls */
29182 {
29183 int_T *callSysOutputs = (int_T *)
29184 &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysOutputs;
29185 void **callSysArgs1 = (void **)
29186 &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysArgs1;
29187 int_T *callSysArgs2 = (int_T *)
29188 &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysArgs2;
29189 SysOutputFcn *callSysFcns = (SysOutputFcn *)
29190 &L4_MABX_M->NonInlinedSFcns.Sfcn2.callSysFcns;
29191
29192 {
29193 int32_T i;
29194 for (i = 0; i < 1; i++) {
29195 callSysOutputs[i] = 0;
29196 callSysFcns[i] = (SysOutputFcn) (NULL);
29197 callSysFcns[1+i] = (SysOutputFcn) (NULL);
29198 callSysFcns[2*1+i] = (SysOutputFcn) (NULL);
29199 callSysFcns[3*1+i] = (SysOutputFcn) (NULL);
29200 }
29201 }
29202
29203 ssSetCallSystemOutputPtr(rts, &callSysOutputs[0]);
29204 ssSetCallSystemOutputArg1List(rts, &callSysArgs1[0]);
29205 ssSetCallSystemOutputArg2List(rts, &callSysArgs2[0]);
29206 ssSetCallSystemOutputFcnList(rts, &callSysFcns[0]);
29207 callSysArgs1[0] = (void *)L4_MABX_M;
29208 callSysArgs2[0] = 0;
29209 callSysFcns[0] = (SysOutputFcn) L4_MABX_TcpInputProcessingFNI;
29210 callSysFcns[1+0] = (SysOutputFcn) L4_TcpInputProcessing_ResetFNI;
29211 callSysFcns[2+0] = (SysOutputFcn) (NULL);
29212 callSysFcns[3+0] = (SysOutputFcn) (NULL);
29213 callSysOutputs[0] = 1;
29214 }
29215
29216 /* registration */
29217 dsa_tcpip_irq_l1_sfcn(rts);
29218 sfcnInitializeSizes(rts);
29219 sfcnInitializeSampleTimes(rts);
29220
29221 /* adjust sample time */
29222 ssSetSampleTime(rts, 0, -1.0);
29223 ssSetOffsetTime(rts, 0, -4.0);
29224 sfcnTsMap[0] = 11;
29225
29226 /* set compiled values of dynamic vector attributes */
29227 ssSetOutputPortWidth(rts, 0, 1);
29228 ssSetNumNonsampledZCs(rts, 0);
29229
29230 /* Update connectivity flags for each port */
29231 _ssSetOutputPortConnected(rts, 0, 1);
29232 _ssSetOutputPortBeingMerged(rts, 0, 0);
29233
29234 /* Update the BufferDstPort flags for each input port */
29235 }
29236
29237 /* Level2 S-Function Block: L4_MABX/<S399>/dsa_tcpip_setup (dsa_tcpip_setup_sfcn) */
29238 {
29239 SimStruct *rts = L4_MABX_M->childSfunctions[3];
29240
29241 /* timing info */
29242 time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn3.sfcnPeriod;
29243 time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn3.sfcnOffset;
29244 int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn3.sfcnTsMap;
29245 (void) memset((void*)sfcnPeriod, 0,
29246 sizeof(time_T)*1);
29247 (void) memset((void*)sfcnOffset, 0,
29248 sizeof(time_T)*1);
29249 ssSetSampleTimePtr(rts, &sfcnPeriod[0]);
29250 ssSetOffsetTimePtr(rts, &sfcnOffset[0]);
29251 ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap);
29252
29253 {
29254 ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[3]);
29255 }
29256
29257 _ssSetBlkInfo2PortInfo2Ptr(rts,
29258 &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[3]);
29259
29260 /* Set up the mdlInfo pointer */
29261 ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo);
29262
29263 /* Allocate memory of model methods 2 */
29264 {
29265 ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[3]);
29266 }
29267
29268 /* Allocate memory of model methods 3 */
29269 {
29270 ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[3]);
29271 }
29272
29273 /* Allocate memory of model methods 4 */
29274 {
29275 ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[3]);
29276 }
29277
29278 /* Allocate memory for states auxilliary information */
29279 {
29280 ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[3]);
29281 ssSetPeriodicStatesInfo(rts,
29282 &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[3]);
29283 }
29284
29285 /* outputs */
29286 {
29287 ssSetPortInfoForOutputs(rts,
29288 &L4_MABX_M->NonInlinedSFcns.Sfcn3.outputPortInfo[0]);
29289 _ssSetNumOutputPorts(rts, 1);
29290 _ssSetPortInfo2ForOutputUnits(rts,
29291 &L4_MABX_M->NonInlinedSFcns.Sfcn3.outputPortUnits[0]);
29292 ssSetOutputPortUnit(rts, 0, 0);
29293 _ssSetPortInfo2ForOutputCoSimAttribute(rts,
29294 &L4_MABX_M->NonInlinedSFcns.Sfcn3.outputPortCoSimAttribute[0]);
29295 ssSetOutputPortIsContinuousQuantity(rts, 0, 0);
29296
29297 /* port 0 */
29298 {
29299 _ssSetOutputPortNumDimensions(rts, 0, 1);
29300 ssSetOutputPortWidth(rts, 0, 1);
29301 ssSetOutputPortSignal(rts, 0, ((real_T *) &EthernetLinkStatus));
29302 }
29303 }
29304
29305 /* path info */
29306 ssSetModelName(rts, "dsa_tcpip_setup");
29307 ssSetPath(rts, "L4_MABX/ETHERNET/TCPIP_Setup/dsa_tcpip_setup");
29308 ssSetRTModel(rts,L4_MABX_M);
29309 ssSetParentSS(rts, (NULL));
29310 ssSetRootSS(rts, rts);
29311 ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2);
29312
29313 /* parameters */
29314 {
29315 mxArray **sfcnParams = (mxArray **)
29316 &L4_MABX_M->NonInlinedSFcns.Sfcn3.params;
29317 ssSetSFcnParamsCount(rts, 6);
29318 ssSetSFcnParamsPtr(rts, &sfcnParams[0]);
29319 ssSetSFcnParam(rts, 0, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P1_Size);
29320 ssSetSFcnParam(rts, 1, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P2_Size);
29321 ssSetSFcnParam(rts, 2, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P3_Size);
29322 ssSetSFcnParam(rts, 3, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P4_Size);
29323 ssSetSFcnParam(rts, 4, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P5_Size);
29324 ssSetSFcnParam(rts, 5, (mxArray*)L4_MABX_P.dsa_tcpip_setup_P6_Size);
29325 }
29326
29327 /* work vectors */
29328 ssSetIWork(rts, (int_T *) &L4_MABX_DW.dsa_tcpip_setup_IWORK);
29329 ssSetPWork(rts, (void **) &L4_MABX_DW.dsa_tcpip_setup_PWORK);
29330
29331 {
29332 struct _ssDWorkRecord *dWorkRecord = (struct _ssDWorkRecord *)
29333 &L4_MABX_M->NonInlinedSFcns.Sfcn3.dWork;
29334 struct _ssDWorkAuxRecord *dWorkAuxRecord = (struct _ssDWorkAuxRecord *)
29335 &L4_MABX_M->NonInlinedSFcns.Sfcn3.dWorkAux;
29336 ssSetSFcnDWork(rts, dWorkRecord);
29337 ssSetSFcnDWorkAux(rts, dWorkAuxRecord);
29338 _ssSetNumDWork(rts, 2);
29339
29340 /* IWORK */
29341 ssSetDWorkWidth(rts, 0, 1);
29342 ssSetDWorkDataType(rts, 0,SS_INTEGER);
29343 ssSetDWorkComplexSignal(rts, 0, 0);
29344 ssSetDWork(rts, 0, &L4_MABX_DW.dsa_tcpip_setup_IWORK);
29345
29346 /* PWORK */
29347 ssSetDWorkWidth(rts, 1, 1);
29348 ssSetDWorkDataType(rts, 1,SS_POINTER);
29349 ssSetDWorkComplexSignal(rts, 1, 0);
29350 ssSetDWork(rts, 1, &L4_MABX_DW.dsa_tcpip_setup_PWORK);
29351 }
29352
29353 /* registration */
29354 dsa_tcpip_setup_sfcn(rts);
29355 sfcnInitializeSizes(rts);
29356 sfcnInitializeSampleTimes(rts);
29357
29358 /* adjust sample time */
29359 ssSetSampleTime(rts, 0, 0.01);
29360 ssSetOffsetTime(rts, 0, 0.0);
29361 sfcnTsMap[0] = 0;
29362
29363 /* set compiled values of dynamic vector attributes */
29364 ssSetNumNonsampledZCs(rts, 0);
29365
29366 /* Update connectivity flags for each port */
29367 _ssSetOutputPortConnected(rts, 0, 1);
29368 _ssSetOutputPortBeingMerged(rts, 0, 0);
29369
29370 /* Update the BufferDstPort flags for each input port */
29371 }
29372
29373 /* Level2 S-Function Block: L4_MABX/<S400>/TCPIP_Com (dsa_tcpip_udp_sfcn) */
29374 {
29375 SimStruct *rts = L4_MABX_M->childSfunctions[4];
29376
29377 /* timing info */
29378 time_T *sfcnPeriod = L4_MABX_M->NonInlinedSFcns.Sfcn4.sfcnPeriod;
29379 time_T *sfcnOffset = L4_MABX_M->NonInlinedSFcns.Sfcn4.sfcnOffset;
29380 int_T *sfcnTsMap = L4_MABX_M->NonInlinedSFcns.Sfcn4.sfcnTsMap;
29381 (void) memset((void*)sfcnPeriod, 0,
29382 sizeof(time_T)*1);
29383 (void) memset((void*)sfcnOffset, 0,
29384 sizeof(time_T)*1);
29385 ssSetSampleTimePtr(rts, &sfcnPeriod[0]);
29386 ssSetOffsetTimePtr(rts, &sfcnOffset[0]);
29387 ssSetSampleTimeTaskIDPtr(rts, sfcnTsMap);
29388
29389 {
29390 ssSetBlkInfo2Ptr(rts, &L4_MABX_M->NonInlinedSFcns.blkInfo2[4]);
29391 }
29392
29393 _ssSetBlkInfo2PortInfo2Ptr(rts,
29394 &L4_MABX_M->NonInlinedSFcns.inputOutputPortInfo2[4]);
29395
29396 /* Set up the mdlInfo pointer */
29397 ssSetRTWSfcnInfo(rts, L4_MABX_M->sfcnInfo);
29398
29399 /* Allocate memory of model methods 2 */
29400 {
29401 ssSetModelMethods2(rts, &L4_MABX_M->NonInlinedSFcns.methods2[4]);
29402 }
29403
29404 /* Allocate memory of model methods 3 */
29405 {
29406 ssSetModelMethods3(rts, &L4_MABX_M->NonInlinedSFcns.methods3[4]);
29407 }
29408
29409 /* Allocate memory of model methods 4 */
29410 {
29411 ssSetModelMethods4(rts, &L4_MABX_M->NonInlinedSFcns.methods4[4]);
29412 }
29413
29414 /* Allocate memory for states auxilliary information */
29415 {
29416 ssSetStatesInfo2(rts, &L4_MABX_M->NonInlinedSFcns.statesInfo2[4]);
29417 ssSetPeriodicStatesInfo(rts,
29418 &L4_MABX_M->NonInlinedSFcns.periodicStatesInfo[4]);
29419 }
29420
29421 /* inputs */
29422 {
29423 _ssSetNumInputPorts(rts, 3);
29424 ssSetPortInfoForInputs(rts,
29425 &L4_MABX_M->NonInlinedSFcns.Sfcn4.inputPortInfo[0]);
29426 _ssSetPortInfo2ForInputUnits(rts,
29427 &L4_MABX_M->NonInlinedSFcns.Sfcn4.inputPortUnits[0]);
29428 ssSetInputPortUnit(rts, 0, 0);
29429 ssSetInputPortUnit(rts, 1, 0);
29430 ssSetInputPortUnit(rts, 2, 0);
29431 _ssSetPortInfo2ForInputCoSimAttribute(rts,
29432 &L4_MABX_M->NonInlinedSFcns.Sfcn4.inputPortCoSimAttribute[0]);
29433 ssSetInputPortIsContinuousQuantity(rts, 0, 0);
29434 ssSetInputPortIsContinuousQuantity(rts, 1, 0);
29435 ssSetInputPortIsContinuousQuantity(rts, 2, 0);
29436
29437 /* port 0 */
29438 {
29439 boolean_T const **sfcnUPtrs = (boolean_T const **)
29440 &L4_MABX_M->NonInlinedSFcns.Sfcn4.UPtrs0;
29441 sfcnUPtrs[0] = &L4_MABX_B.Enable;
29442 ssSetInputPortSignalPtrs(rts, 0, (InputPtrsType)&sfcnUPtrs[0]);
29443 _ssSetInputPortNumDimensions(rts, 0, 1);
29444 ssSetInputPortWidth(rts, 0, 1);
29445 }
29446
29447 /* port 1 */
29448 {
29449 uint32_T const **sfcnUPtrs = (uint32_T const **)
29450 &L4_MABX_M->NonInlinedSFcns.Sfcn4.UPtrs1;
29451 sfcnUPtrs[0] = &L4_MABX_B.Encoder_o2;
29452 ssSetInputPortSignalPtrs(rts, 1, (InputPtrsType)&sfcnUPtrs[0]);
29453 _ssSetInputPortNumDimensions(rts, 1, 1);
29454 ssSetInputPortWidth(rts, 1, 1);
29455 }
29456
29457 /* port 2 */
29458 {
29459 uint8_T const **sfcnUPtrs = (uint8_T const **)
29460 &L4_MABX_M->NonInlinedSFcns.Sfcn4.UPtrs2;
29461
29462 {
29463 int_T i1;
29464 const uint8_T *u2 = L4_MABX_B.Encoder_o1;
29465 for (i1=0; i1 < 24; i1++) {
29466 sfcnUPtrs[i1] = &u2[i1];
29467 }
29468 }
29469
29470 ssSetInputPortSignalPtrs(rts, 2, (InputPtrsType)&sfcnUPtrs[0]);
29471 _ssSetInputPortNumDimensions(rts, 2, 1);
29472 ssSetInputPortWidth(rts, 2, 24);
29473 }
29474 }
29475
29476 /* outputs */
29477 {
29478 ssSetPortInfoForOutputs(rts,
29479 &L4_MABX_M->NonInlinedSFcns.Sfcn4.outputPortInfo[0]);
29480 _ssSetNumOutputPorts(rts, 3);
29481 _ssSetPortInfo2ForOutputUnits(rts,
29482 &L4_MABX_M->NonInlinedSFcns.Sfcn4.outputPortUnits[0]);
29483 ssSetOutputPortUnit(rts, 0, 0);
29484 ssSetOutputPortUnit(rts, 1, 0);
29485 ssSetOutputPortUnit(rts, 2, 0);
29486 _ssSetPortInfo2ForOutputCoSimAttribute(rts,
29487 &L4_MABX_M->NonInlinedSFcns.Sfcn4.outputPortCoSimAttribute[0]);
29488 ssSetOutputPortIsContinuousQuantity(rts, 0, 0);
29489 ssSetOutputPortIsContinuousQuantity(rts, 1, 0);
29490 ssSetOutputPortIsContinuousQuantity(rts, 2, 0);
29491
29492 /* port 0 */
29493 {
29494 _ssSetOutputPortNumDimensions(rts, 0, 1);
29495 ssSetOutputPortWidth(rts, 0, 3);
29496 ssSetOutputPortSignal(rts, 0, ((uint32_T *) L4_MABX_B.TCPIP_Com_o1));
29497 }
29498
29499 /* port 1 */
29500 {
29501 _ssSetOutputPortNumDimensions(rts, 1, 1);
29502 ssSetOutputPortWidth(rts, 1, 1);
29503 ssSetOutputPortSignal(rts, 1, ((uint32_T *) &L4_MABX_B.TCPIP_Com_o2));
29504 }
29505
29506 /* port 2 */
29507 {
29508 _ssSetOutputPortNumDimensions(rts, 2, 1);
29509 ssSetOutputPortWidth(rts, 2, 128);
29510 ssSetOutputPortSignal(rts, 2, ((uint8_T *) L4_MABX_B.TCPIP_Com_o3));
29511 }
29512 }
29513
29514 /* path info */
29515 ssSetModelName(rts, "TCPIP_Com");
29516 ssSetPath(rts, "L4_MABX/ETHERNET/UDPIP_Communication/TCPIP_Com");
29517 ssSetRTModel(rts,L4_MABX_M);
29518 ssSetParentSS(rts, (NULL));
29519 ssSetRootSS(rts, rts);
29520 ssSetVersion(rts, SIMSTRUCT_VERSION_LEVEL2);
29521
29522 /* parameters */
29523 {
29524 mxArray **sfcnParams = (mxArray **)
29525 &L4_MABX_M->NonInlinedSFcns.Sfcn4.params;
29526 ssSetSFcnParamsCount(rts, 6);
29527 ssSetSFcnParamsPtr(rts, &sfcnParams[0]);
29528 ssSetSFcnParam(rts, 0, (mxArray*)L4_MABX_P.TCPIP_Com_P1_Size);
29529 ssSetSFcnParam(rts, 1, (mxArray*)L4_MABX_P.TCPIP_Com_P2_Size);
29530 ssSetSFcnParam(rts, 2, (mxArray*)L4_MABX_P.TCPIP_Com_P3_Size);
29531 ssSetSFcnParam(rts, 3, (mxArray*)L4_MABX_P.TCPIP_Com_P4_Size);
29532 ssSetSFcnParam(rts, 4, (mxArray*)L4_MABX_P.TCPIP_Com_P5_Size);
29533 ssSetSFcnParam(rts, 5, (mxArray*)L4_MABX_P.TCPIP_Com_P6_Size);
29534 }
29535
29536 /* work vectors */
29537 ssSetPWork(rts, (void **) &L4_MABX_DW.TCPIP_Com_PWORK);
29538
29539 {
29540 struct _ssDWorkRecord *dWorkRecord = (struct _ssDWorkRecord *)
29541 &L4_MABX_M->NonInlinedSFcns.Sfcn4.dWork;
29542 struct _ssDWorkAuxRecord *dWorkAuxRecord = (struct _ssDWorkAuxRecord *)
29543 &L4_MABX_M->NonInlinedSFcns.Sfcn4.dWorkAux;
29544 ssSetSFcnDWork(rts, dWorkRecord);
29545 ssSetSFcnDWorkAux(rts, dWorkAuxRecord);
29546 _ssSetNumDWork(rts, 1);
29547
29548 /* PWORK */
29549 ssSetDWorkWidth(rts, 0, 1);
29550 ssSetDWorkDataType(rts, 0,SS_POINTER);
29551 ssSetDWorkComplexSignal(rts, 0, 0);
29552 ssSetDWork(rts, 0, &L4_MABX_DW.TCPIP_Com_PWORK);
29553 }
29554
29555 /* registration */
29556 dsa_tcpip_udp_sfcn(rts);
29557 sfcnInitializeSizes(rts);
29558 sfcnInitializeSampleTimes(rts);
29559
29560 /* adjust sample time */
29561 ssSetSampleTime(rts, 0, 0.01);
29562 ssSetOffsetTime(rts, 0, 0.0);
29563 sfcnTsMap[0] = 0;
29564
29565 /* set compiled values of dynamic vector attributes */
29566 ssSetNumNonsampledZCs(rts, 0);
29567
29568 /* Update connectivity flags for each port */
29569 _ssSetInputPortConnected(rts, 0, 1);
29570 _ssSetInputPortConnected(rts, 1, 1);
29571 _ssSetInputPortConnected(rts, 2, 1);
29572 _ssSetOutputPortConnected(rts, 0, 1);
29573 _ssSetOutputPortConnected(rts, 1, 1);
29574 _ssSetOutputPortConnected(rts, 2, 1);
29575 _ssSetOutputPortBeingMerged(rts, 0, 0);
29576 _ssSetOutputPortBeingMerged(rts, 1, 0);
29577 _ssSetOutputPortBeingMerged(rts, 2, 0);
29578
29579 /* Update the BufferDstPort flags for each input port */
29580 ssSetInputPortBufferDstPort(rts, 0, -1);
29581 ssSetInputPortBufferDstPort(rts, 1, -1);
29582 ssSetInputPortBufferDstPort(rts, 2, -1);
29583 }
29584 }
29585
29586 {
29587 /* user code (registration function declaration) */
29588 /*Initialize global TRC pointers. */
29589 L4_MABX_rti_init_trc_pointers();
29590 }
29591
29592 /* Start for Enabled SubSystem: '<S744>/Slew_at_event' */
29593 L4_MABX_DW.Slew_at_event_MODE = false;
29594
29595 /* End of Start for SubSystem: '<S744>/Slew_at_event' */
29596
29597 /* Start for S-Function (dsa_tcpip_setup_sfcn): '<S399>/dsa_tcpip_setup' */
29598 /* Level2 S-Function Block: '<S399>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */
29599 {
29600 SimStruct *rts = L4_MABX_M->childSfunctions[3];
29601 sfcnStart(rts);
29602 if (ssGetErrorStatus(rts) != (NULL))
29603 return;
29604 }
29605
29606 /* Start for Constant: '<S3>/Enable' */
29607 L4_MABX_B.Enable = L4_MABX_P.Enable_Value;
29608
29609 /* Start for S-Function (dsa_gen_tx_RTMapsEncode_sfun): '<S407>/Encoder' */
29610 Init_Tx_RTMapsEncode();
29611
29612 /* Start for S-Function (dsa_tcpip_udp_sfcn): '<S400>/TCPIP_Com' */
29613 /* Level2 S-Function Block: '<S400>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */
29614 {
29615 SimStruct *rts = L4_MABX_M->childSfunctions[4];
29616 sfcnStart(rts);
29617 if (ssGetErrorStatus(rts) != (NULL))
29618 return;
29619 }
29620
29621 /* Start for S-Function (dsa_gen_rx_RTMapsDecode_sfun): '<S404>/Decoder' */
29622 Init_Rx_RTMapsDecode();
29623
29624 /* Start for Atomic SubSystem: '<S65>/Task_10ms' */
29625 /* Start for RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' */
29626 L4_MABX_B.distanceSpdTarget_e = L4_MABX_P.TmpRTBAtSignalConversion1Inport;
29627
29628 /* Start for Enabled SubSystem: '<S79>/Throttle_controller_gov' */
29629 L4_MABX_DW.Throttle_controller_gov_MODE = false;
29630
29631 /* Start for Enabled SubSystem: '<S244>/Calculate_D_term' */
29632 L4_M_Calculate_D_term_Start(&L4_MABX_DW.Calculate_D_term_h);
29633
29634 /* End of Start for SubSystem: '<S244>/Calculate_D_term' */
29635
29636 /* Start for Enabled SubSystem: '<S244>/Calculate_I_term' */
29637 L4_M_Calculate_I_term_Start(&L4_MABX_DW.Calculate_I_term_n);
29638
29639 /* End of Start for SubSystem: '<S244>/Calculate_I_term' */
29640
29641 /* End of Start for SubSystem: '<S79>/Throttle_controller_gov' */
29642
29643 /* Start for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */
29644 L4_MABX_DW.Determine_shift_interlock_brake = false;
29645
29646 /* End of Start for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */
29647
29648 /* Start for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' */
29649 L4_MABX_DW.Determine_brake_hold_pressure_t = false;
29650
29651 /* End of Start for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */
29652
29653 /* Start for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */
29654 L4_MABX_DW.Bendix_2C2_brake_application_pr = false;
29655
29656 /* Start for Enabled SubSystem: '<S112>/Calculate_D_term' */
29657 L4_M_Calculate_D_term_Start(&L4_MABX_DW.Calculate_D_term);
29658
29659 /* End of Start for SubSystem: '<S112>/Calculate_D_term' */
29660
29661 /* Start for Enabled SubSystem: '<S112>/Calculate_I_term' */
29662 L4_M_Calculate_I_term_Start(&L4_MABX_DW.Calculate_I_term);
29663
29664 /* End of Start for SubSystem: '<S112>/Calculate_I_term' */
29665
29666 /* End of Start for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */
29667
29668 /* Start for RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' */
29669 L4_MABX_B.pathSpdLimit_a = L4_MABX_P.TmpRTBAtSignalConversion3Inport;
29670
29671 /* Start for RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' */
29672 L4_MABX_B.distance_o = L4_MABX_P.TmpRTBAtSignalConversion2Inport;
29673
29674 /* Start for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */
29675 L4_MABX_DW.Bendix_2C2_vehicle_speed_feedba = false;
29676
29677 /* Start for Enabled SubSystem: '<S150>/Calculate_D_term' */
29678 L4_M_Calculate_D_term_Start(&L4_MABX_DW.Calculate_D_term_p);
29679
29680 /* End of Start for SubSystem: '<S150>/Calculate_D_term' */
29681
29682 /* Start for Enabled SubSystem: '<S150>/Calculate_I_term' */
29683 L4_M_Calculate_I_term_Start(&L4_MABX_DW.Calculate_I_term_e);
29684
29685 /* End of Start for SubSystem: '<S150>/Calculate_I_term' */
29686
29687 /* End of Start for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */
29688
29689 /* Start for Enabled SubSystem: '<S79>/Engine_speed_target' */
29690 L4_MABX_DW.Engine_speed_target_MODE = false;
29691
29692 /* End of Start for SubSystem: '<S79>/Engine_speed_target' */
29693
29694 /* Start for Enabled SubSystem: '<S283>/Slew_at_event' */
29695 L4_MABX_DW.Slew_at_event_MODE_d = false;
29696
29697 /* End of Start for SubSystem: '<S283>/Slew_at_event' */
29698
29699 /* Start for RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' */
29700 L4_MABX_B.previewSteeringAngle_b = L4_MABX_P.TmpRTBAtrad2deg1Inport1_Initial;
29701
29702 /* Start for RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' */
29703 L4_MABX_B.TmpRTBAtsignCurveOffsetInport1 =
29704 L4_MABX_P.TmpRTBAtsignCurveOffsetInport1_;
29705
29706 /* Start for RateTransition: '<S284>/TmpRTBAtAdd2Inport2' */
29707 L4_MABX_B.TmpRTBAtAdd2Inport2 = L4_MABX_P.TmpRTBAtAdd2Inport2_InitialCond;
29708
29709 /* End of Start for SubSystem: '<S65>/Task_10ms' */
29710
29711 /* Start for Atomic SubSystem: '<S849>/CAN_TX_10ms' */
29712
29713 /* Start for Width: '<S1006>/Width' */
29714 L4_MABX_B.Width_p = 16U;
29715
29716 /* End of Start for SubSystem: '<S849>/CAN_TX_10ms' */
29717
29718 /* Start for Atomic SubSystem: '<S849>/CAN_TX_20ms' */
29719
29720 /* Start for Width: '<S1034>/Width' */
29721 L4_MABX_B.Width_h = 16U;
29722
29723 /* End of Start for SubSystem: '<S849>/CAN_TX_20ms' */
29724
29725 /* Start for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */
29726
29727 /* Start for Width: '<S1049>/Width' */
29728 L4_MABX_B.Width = 8U;
29729
29730 /* End of Start for SubSystem: '<S849>/CAN_TX_5000ms' */
29731
29732 /* Start for RateTransition: '<S1077>/TmpRTBAtFlashOutport1' */
29733 L4_MABX_B.TmpRTBAtFlashOutport1 = L4_MABX_P.TmpRTBAtFlashOutport1_InitialCo;
29734
29735 /* Start for Atomic SubSystem: '<S65>/Task_20ms' */
29736 /* Start for Constant: '<S396>/InitialHeading' */
29737 L4_MABX_B.InitialHeading = L4_MABX_P.InitialHeading_Value;
29738
29739 /* Start for Constant: '<S396>/InitialPosition' */
29740 L4_MABX_B.InitialPosition = L4_MABX_P.InitialPosition_Value;
29741
29742 /* Start for Constant: '<S396>/InitialXPosition' */
29743 L4_MABX_B.InitialXPosition = L4_MABX_P.InitialXPosition_Value;
29744
29745 /* Start for Constant: '<S396>/InitialYPosition' */
29746 L4_MABX_B.InitialYPosition = L4_MABX_P.InitialYPosition_Value;
29747
29748 /* End of Start for SubSystem: '<S65>/Task_20ms' */
29749
29750 /* Start for S-Function (rti_commonblock): '<S408>/S-Function1' incorporates:
29751 * SubSystem: '<S399>/Background_Task'
29752 */
29753 L4_MA_Background_Task_Start();
29754
29755 /* End of Start for S-Function (rti_commonblock): '<S408>/S-Function1' */
29756
29757 /* Start for S-Function (rti_commonblock): '<S414>/S-Function1' incorporates:
29758 * SubSystem: '<S399>/Interrupt_Task'
29759 */
29760 L4_MAB_Interrupt_Task_Start();
29761
29762 /* End of Start for S-Function (rti_commonblock): '<S414>/S-Function1' */
29763 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C1_Trig_ZCE = UNINITIALIZED_ZCSIG;
29764 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M1_C2_Trig_ZCE = UNINITIALIZED_ZCSIG;
29765 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C1_Trig_ZCE = UNINITIALIZED_ZCSIG;
29766 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M2_C2_Trig_ZCE = UNINITIALIZED_ZCSIG;
29767 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C1_Trig_ZCE = UNINITIALIZED_ZCSIG;
29768 L4_MABX_PrevZCX.CAN_TYPE1_BOR_M3_C2_Trig_ZCE = UNINITIALIZED_ZCSIG;
29769 L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE_e = POS_ZCSIG;
29770 L4_MABX_PrevZCX.CAN_TYPE1_TX_M1_C1_Trig_ZCE = POS_ZCSIG;
29771
29772 {
29773 int32_T i;
29774
29775 /* InitializeConditions for UnitDelay: '<S757>/Unit Delay' */
29776 L4_MABX_DW.UnitDelay_DSTATE = L4_MABX_P.UnitDelay_InitialCondition_m;
29777
29778 /* InitializeConditions for UnitDelay: '<S755>/Delay Input1' */
29779 L4_MABX_DW.DelayInput1_DSTATE_n = L4_MABX_P.DetectRisePositive_vinit;
29780
29781 /* InitializeConditions for UnitDelay: '<S756>/Unit Delay' */
29782 L4_MABX_DW.UnitDelay_DSTATE_m = L4_MABX_P.UnitDelay_InitialCondition_mf;
29783
29784 /* InitializeConditions for UnitDelay: '<S743>/Unit Delay' */
29785 L4_MABX_DW.UnitDelay_DSTATE_o = L4_MABX_P.UnitDelay_InitialCondition_gq;
29786
29787 /* InitializeConditions for UnitDelay: '<S754>/Delay Input1' */
29788 L4_MABX_DW.DelayInput1_DSTATE_p = L4_MABX_P.DetectFallNonpositive_vinit_d;
29789
29790 /* InitializeConditions for UnitDelay: '<S756>/Unit Delay1' */
29791 L4_MABX_DW.UnitDelay1_DSTATE_kw = L4_MABX_P.UnitDelay1_InitialCondition_g;
29792
29793 /* InitializeConditions for UnitDelay: '<S757>/Unit Delay1' */
29794 L4_MABX_DW.UnitDelay1_DSTATE_b = L4_MABX_P.UnitDelay1_InitialCondition_f;
29795
29796 /* InitializeConditions for UnitDelay: '<S796>/FixPt Unit Delay2' */
29797 L4_MABX_DW.FixPtUnitDelay2_DSTATE =
29798 L4_MABX_P.FixPtUnitDelay2_InitialCondit_h;
29799
29800 /* InitializeConditions for UnitDelay: '<S796>/FixPt Unit Delay1' */
29801 L4_MABX_DW.FixPtUnitDelay1_DSTATE =
29802 L4_MABX_P.FixPtUnitDelay1_InitialCondi_lr;
29803
29804 /* InitializeConditions for UnitDelay: '<S788>/FixPt Unit Delay2' */
29805 L4_MABX_DW.FixPtUnitDelay2_DSTATE_i =
29806 L4_MABX_P.FixPtUnitDelay2_InitialCondi_lt;
29807
29808 /* InitializeConditions for UnitDelay: '<S788>/FixPt Unit Delay1' */
29809 L4_MABX_DW.FixPtUnitDelay1_DSTATE_p =
29810 L4_MABX_P.FixPtUnitDelay1_InitialCondi_ld;
29811
29812 /* InitializeConditions for UnitDelay: '<S812>/FixPt Unit Delay2' */
29813 L4_MABX_DW.FixPtUnitDelay2_DSTATE_o =
29814 L4_MABX_P.FixPtUnitDelay2_InitialCondit_m;
29815
29816 /* InitializeConditions for UnitDelay: '<S812>/FixPt Unit Delay1' */
29817 L4_MABX_DW.FixPtUnitDelay1_DSTATE_h =
29818 L4_MABX_P.FixPtUnitDelay1_InitialCondi_l2;
29819
29820 /* InitializeConditions for UnitDelay: '<S804>/FixPt Unit Delay2' */
29821 L4_MABX_DW.FixPtUnitDelay2_DSTATE_k =
29822 L4_MABX_P.FixPtUnitDelay2_InitialCondi_h5;
29823
29824 /* InitializeConditions for UnitDelay: '<S804>/FixPt Unit Delay1' */
29825 L4_MABX_DW.FixPtUnitDelay1_DSTATE_h3 =
29826 L4_MABX_P.FixPtUnitDelay1_InitialCondit_g;
29827
29828 /* InitializeConditions for UnitDelay: '<S766>/Unit_Delay' */
29829 L4_MABX_DW.Unit_Delay_DSTATE_h2 = L4_MABX_P.Unit_Delay_InitialCondition_pp;
29830
29831 /* InitializeConditions for UnitDelay: '<S833>/Unit_Delay1' */
29832 L4_MABX_DW.Unit_Delay1_DSTATE = L4_MABX_P.Unit_Delay1_InitialCondition_n;
29833
29834 /* InitializeConditions for UnitDelay: '<S833>/Unit_Delay2' */
29835 L4_MABX_DW.Unit_Delay2_DSTATE = L4_MABX_P.Unit_Delay2_InitialCondition_o;
29836
29837 /* InitializeConditions for UnitDelay: '<S766>/Unit_Delay1' */
29838 L4_MABX_DW.Unit_Delay1_DSTATE_m = L4_MABX_P.Unit_Delay1_InitialCondition_m2;
29839
29840 /* InitializeConditions for UnitDelay: '<S834>/Unit_Delay1' */
29841 L4_MABX_DW.Unit_Delay1_DSTATE_j = L4_MABX_P.Unit_Delay1_InitialCondition_k;
29842
29843 /* InitializeConditions for UnitDelay: '<S834>/Unit_Delay2' */
29844 L4_MABX_DW.Unit_Delay2_DSTATE_b = L4_MABX_P.Unit_Delay2_InitialCondition_e;
29845
29846 /* InitializeConditions for UnitDelay: '<S832>/FixPt Unit Delay2' */
29847 L4_MABX_DW.FixPtUnitDelay2_DSTATE_ie =
29848 L4_MABX_P.FixPtUnitDelay2_InitialCondit_o;
29849
29850 /* InitializeConditions for UnitDelay: '<S832>/FixPt Unit Delay1' */
29851 L4_MABX_DW.FixPtUnitDelay1_DSTATE_o =
29852 L4_MABX_P.FixPtUnitDelay1_InitialCondit_c;
29853
29854 /* InitializeConditions for UnitDelay: '<S831>/FixPt Unit Delay2' */
29855 L4_MABX_DW.FixPtUnitDelay2_DSTATE_iv =
29856 L4_MABX_P.FixPtUnitDelay2_InitialCondit_j;
29857
29858 /* InitializeConditions for UnitDelay: '<S831>/FixPt Unit Delay1' */
29859 L4_MABX_DW.FixPtUnitDelay1_DSTATE_i =
29860 L4_MABX_P.FixPtUnitDelay1_InitialCondi_dm;
29861
29862 /* InitializeConditions for UnitDelay: '<S820>/FixPt Unit Delay2' */
29863 L4_MABX_DW.FixPtUnitDelay2_DSTATE_b =
29864 L4_MABX_P.FixPtUnitDelay2_InitialCondi_ht;
29865
29866 /* InitializeConditions for UnitDelay: '<S820>/FixPt Unit Delay1' */
29867 L4_MABX_DW.FixPtUnitDelay1_DSTATE_e =
29868 L4_MABX_P.FixPtUnitDelay1_InitialCondi_ch;
29869
29870 /* InitializeConditions for RateTransition: '<S417>/Rate Transition' */
29871 L4_MABX_DW.RateTransition_Buffer0 =
29872 L4_MABX_P.RateTransition_InitialCondition;
29873 L4_MABX_DW.RateTransition_write_buf = -1;
29874 L4_MABX_DW.RateTransition_read_buf = -1;
29875
29876 /* InitializeConditions for UnitDelay: '<S649>/Unit_Delay3' */
29877 L4_MABX_DW.Unit_Delay3_DSTATE = L4_MABX_P.Unit_Delay3_InitialCondition;
29878
29879 /* InitializeConditions for UnitDelay: '<S649>/Unit_Delay' */
29880 L4_MABX_DW.Unit_Delay_DSTATE_k = L4_MABX_P.Unit_Delay_InitialCondition_lst;
29881
29882 /* InitializeConditions for UnitDelay: '<S655>/Unit_Delay' */
29883 L4_MABX_DW.Unit_Delay_DSTATE_dl = L4_MABX_P.Unit_Delay_InitialCondition_ia;
29884
29885 /* InitializeConditions for S-Function (dsa_tcpip_setup_sfcn): '<S399>/dsa_tcpip_setup' */
29886 /* Level2 S-Function Block: '<S399>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */
29887 {
29888 SimStruct *rts = L4_MABX_M->childSfunctions[3];
29889 sfcnInitializeConditions(rts);
29890 if (ssGetErrorStatus(rts) != (NULL))
29891 return;
29892 }
29893
29894 /* InitializeConditions for DiscretePulseGenerator: '<S398>/Heartbeat' */
29895 L4_MABX_DW.clockTickCounter = 0;
29896
29897 /* InitializeConditions for UnitDelay: '<S3>/Unit_Delay' */
29898 L4_MABX_DW.Unit_Delay_80_DSTATE = L4_MABX_P.Unit_Delay_80_InitialCondition;
29899 L4_MABX_DW.Unit_Delay_81_DSTATE = L4_MABX_P.Unit_Delay_81_InitialCondition;
29900 L4_MABX_DW.Unit_Delay_48_DSTATE = L4_MABX_P.Unit_Delay_48_InitialCondition;
29901 L4_MABX_DW.Unit_Delay_83_DSTATE = L4_MABX_P.Unit_Delay_83_InitialCondition;
29902 L4_MABX_DW.Unit_Delay_45_DSTATE = L4_MABX_P.Unit_Delay_45_InitialCondition;
29903 L4_MABX_DW.Unit_Delay_47_DSTATE = L4_MABX_P.Unit_Delay_47_InitialCondition;
29904 L4_MABX_DW.Unit_Delay_84_DSTATE = L4_MABX_P.Unit_Delay_84_InitialCondition;
29905
29906 /* InitializeConditions for S-Function (dsa_tcpip_udp_sfcn): '<S400>/TCPIP_Com' */
29907 /* Level2 S-Function Block: '<S400>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */
29908 {
29909 SimStruct *rts = L4_MABX_M->childSfunctions[4];
29910 sfcnInitializeConditions(rts);
29911 if (ssGetErrorStatus(rts) != (NULL))
29912 return;
29913 }
29914
29915 /* InitializeConditions for UnitDelay: '<S405>/Delay Input1' */
29916 L4_MABX_DW.DelayInput1_DSTATE_np = L4_MABX_P.DetectRisePositive1_vinit;
29917
29918 /* InitializeConditions for UnitDelay: '<S403>/Unit Delay' */
29919 L4_MABX_DW.UnitDelay_DSTATE_k = L4_MABX_P.UnitDelay_InitialCondition_h;
29920
29921 /* InitializeConditions for UnitDelay: '<S859>/Unit Delay2' */
29922 L4_MABX_DW.UnitDelay2_DSTATE = L4_MABX_P.UnitDelay2_InitialCondition;
29923
29924 /* InitializeConditions for UnitDelay: '<S859>/Unit Delay1' */
29925 L4_MABX_DW.UnitDelay1_DSTATE_d = L4_MABX_P.UnitDelay1_InitialCondition_o;
29926
29927 /* InitializeConditions for UnitDelay: '<S859>/Unit Delay3' */
29928 L4_MABX_DW.UnitDelay3_DSTATE = L4_MABX_P.UnitDelay3_InitialCondition;
29929
29930 /* InitializeConditions for RateTransition: '<S1077>/TmpRTBAtFlashOutport1' */
29931 L4_MABX_DW.TmpRTBAtFlashOutport1_Buffer0 =
29932 L4_MABX_P.TmpRTBAtFlashOutport1_InitialCo;
29933
29934 /* InitializeConditions for DiscretePulseGenerator: '<S1077>/Flash' */
29935 L4_MABX_DW.clockTickCounter_f = 0;
29936
29937 /* InitializeConditions for UnitDelay: '<S3>/Unit_Delay' */
29938 L4_MABX_DW.Unit_Delay_1_DSTATE = L4_MABX_P.Unit_Delay_1_InitialCondition_f;
29939 L4_MABX_DW.Unit_Delay_10_DSTATE = L4_MABX_P.Unit_Delay_10_InitialCondition;
29940 L4_MABX_DW.Unit_Delay_100_DSTATE = L4_MABX_P.Unit_Delay_100_InitialCondition;
29941 L4_MABX_DW.Unit_Delay_101_DSTATE = L4_MABX_P.Unit_Delay_101_InitialCondition;
29942 L4_MABX_DW.Unit_Delay_102_DSTATE = L4_MABX_P.Unit_Delay_102_InitialCondition;
29943 L4_MABX_DW.Unit_Delay_103_DSTATE = L4_MABX_P.Unit_Delay_103_InitialCondition;
29944 L4_MABX_DW.Unit_Delay_104_DSTATE = L4_MABX_P.Unit_Delay_104_InitialCondition;
29945 L4_MABX_DW.Unit_Delay_105_DSTATE = L4_MABX_P.Unit_Delay_105_InitialCondition;
29946 L4_MABX_DW.Unit_Delay_106_DSTATE = L4_MABX_P.Unit_Delay_106_InitialCondition;
29947 L4_MABX_DW.Unit_Delay_107_DSTATE = L4_MABX_P.Unit_Delay_107_InitialCondition;
29948 L4_MABX_DW.Unit_Delay_108_DSTATE = L4_MABX_P.Unit_Delay_108_InitialCondition;
29949 L4_MABX_DW.Unit_Delay_109_DSTATE = L4_MABX_P.Unit_Delay_109_InitialCondition;
29950 L4_MABX_DW.Unit_Delay_11_DSTATE = L4_MABX_P.Unit_Delay_11_InitialCondition;
29951 L4_MABX_DW.Unit_Delay_110_DSTATE = L4_MABX_P.Unit_Delay_110_InitialCondition;
29952 L4_MABX_DW.Unit_Delay_111_DSTATE = L4_MABX_P.Unit_Delay_111_InitialCondition;
29953 L4_MABX_DW.Unit_Delay_112_DSTATE = L4_MABX_P.Unit_Delay_112_InitialCondition;
29954 L4_MABX_DW.Unit_Delay_113_DSTATE = L4_MABX_P.Unit_Delay_113_InitialCondition;
29955 L4_MABX_DW.Unit_Delay_114_DSTATE = L4_MABX_P.Unit_Delay_114_InitialCondition;
29956 L4_MABX_DW.Unit_Delay_115_DSTATE = L4_MABX_P.Unit_Delay_115_InitialCondition;
29957 L4_MABX_DW.Unit_Delay_116_DSTATE = L4_MABX_P.Unit_Delay_116_InitialCondition;
29958 L4_MABX_DW.Unit_Delay_117_DSTATE = L4_MABX_P.Unit_Delay_117_InitialCondition;
29959 L4_MABX_DW.Unit_Delay_118_DSTATE = L4_MABX_P.Unit_Delay_118_InitialCondition;
29960 L4_MABX_DW.Unit_Delay_119_DSTATE = L4_MABX_P.Unit_Delay_119_InitialCondition;
29961 L4_MABX_DW.Unit_Delay_12_DSTATE = L4_MABX_P.Unit_Delay_12_InitialCondition;
29962 L4_MABX_DW.Unit_Delay_120_DSTATE = L4_MABX_P.Unit_Delay_120_InitialCondition;
29963 L4_MABX_DW.Unit_Delay_121_DSTATE = L4_MABX_P.Unit_Delay_121_InitialCondition;
29964 L4_MABX_DW.Unit_Delay_122_DSTATE = L4_MABX_P.Unit_Delay_122_InitialCondition;
29965 L4_MABX_DW.Unit_Delay_123_DSTATE = L4_MABX_P.Unit_Delay_123_InitialCondition;
29966 L4_MABX_DW.Unit_Delay_124_DSTATE = L4_MABX_P.Unit_Delay_124_InitialCondition;
29967 L4_MABX_DW.Unit_Delay_125_DSTATE = L4_MABX_P.Unit_Delay_125_InitialCondition;
29968 L4_MABX_DW.Unit_Delay_126_DSTATE = L4_MABX_P.Unit_Delay_126_InitialCondition;
29969 L4_MABX_DW.Unit_Delay_127_DSTATE = L4_MABX_P.Unit_Delay_127_InitialCondition;
29970 L4_MABX_DW.Unit_Delay_128_DSTATE = L4_MABX_P.Unit_Delay_128_InitialCondition;
29971 L4_MABX_DW.Unit_Delay_129_DSTATE = L4_MABX_P.Unit_Delay_129_InitialCondition;
29972 L4_MABX_DW.Unit_Delay_13_DSTATE = L4_MABX_P.Unit_Delay_13_InitialCondition;
29973 L4_MABX_DW.Unit_Delay_130_DSTATE = L4_MABX_P.Unit_Delay_130_InitialCondition;
29974 L4_MABX_DW.Unit_Delay_131_DSTATE = L4_MABX_P.Unit_Delay_131_InitialCondition;
29975 L4_MABX_DW.Unit_Delay_132_DSTATE = L4_MABX_P.Unit_Delay_132_InitialCondition;
29976 L4_MABX_DW.Unit_Delay_133_DSTATE = L4_MABX_P.Unit_Delay_133_InitialCondition;
29977 L4_MABX_DW.Unit_Delay_134_DSTATE = L4_MABX_P.Unit_Delay_134_InitialCondition;
29978 L4_MABX_DW.Unit_Delay_135_DSTATE = L4_MABX_P.Unit_Delay_135_InitialCondition;
29979 L4_MABX_DW.Unit_Delay_136_DSTATE = L4_MABX_P.Unit_Delay_136_InitialCondition;
29980 L4_MABX_DW.Unit_Delay_137_DSTATE = L4_MABX_P.Unit_Delay_137_InitialCondition;
29981 L4_MABX_DW.Unit_Delay_138_DSTATE = L4_MABX_P.Unit_Delay_138_InitialCondition;
29982 L4_MABX_DW.Unit_Delay_139_DSTATE = L4_MABX_P.Unit_Delay_139_InitialCondition;
29983 L4_MABX_DW.Unit_Delay_14_DSTATE = L4_MABX_P.Unit_Delay_14_InitialCondition;
29984 L4_MABX_DW.Unit_Delay_140_DSTATE = L4_MABX_P.Unit_Delay_140_InitialCondition;
29985 L4_MABX_DW.Unit_Delay_141_DSTATE = L4_MABX_P.Unit_Delay_141_InitialCondition;
29986 L4_MABX_DW.Unit_Delay_142_DSTATE = L4_MABX_P.Unit_Delay_142_InitialCondition;
29987 L4_MABX_DW.Unit_Delay_143_DSTATE = L4_MABX_P.Unit_Delay_143_InitialCondition;
29988 L4_MABX_DW.Unit_Delay_144_DSTATE = L4_MABX_P.Unit_Delay_144_InitialCondition;
29989 L4_MABX_DW.Unit_Delay_15_DSTATE = L4_MABX_P.Unit_Delay_15_InitialCondition;
29990 L4_MABX_DW.Unit_Delay_16_DSTATE = L4_MABX_P.Unit_Delay_16_InitialCondition;
29991 L4_MABX_DW.Unit_Delay_17_DSTATE = L4_MABX_P.Unit_Delay_17_InitialCondition;
29992 L4_MABX_DW.Unit_Delay_18_DSTATE = L4_MABX_P.Unit_Delay_18_InitialCondition;
29993 L4_MABX_DW.Unit_Delay_19_DSTATE = L4_MABX_P.Unit_Delay_19_InitialCondition;
29994 L4_MABX_DW.Unit_Delay_2_DSTATE = L4_MABX_P.Unit_Delay_2_InitialCondition_f;
29995 L4_MABX_DW.Unit_Delay_20_DSTATE = L4_MABX_P.Unit_Delay_20_InitialCondition;
29996 L4_MABX_DW.Unit_Delay_21_DSTATE = L4_MABX_P.Unit_Delay_21_InitialCondition;
29997 L4_MABX_DW.Unit_Delay_22_DSTATE = L4_MABX_P.Unit_Delay_22_InitialCondition;
29998 L4_MABX_DW.Unit_Delay_23_DSTATE = L4_MABX_P.Unit_Delay_23_InitialCondition;
29999 L4_MABX_DW.Unit_Delay_24_DSTATE = L4_MABX_P.Unit_Delay_24_InitialCondition;
30000 L4_MABX_DW.Unit_Delay_25_DSTATE = L4_MABX_P.Unit_Delay_25_InitialCondition;
30001 L4_MABX_DW.Unit_Delay_26_DSTATE = L4_MABX_P.Unit_Delay_26_InitialCondition;
30002 L4_MABX_DW.Unit_Delay_27_DSTATE = L4_MABX_P.Unit_Delay_27_InitialCondition;
30003 L4_MABX_DW.Unit_Delay_28_DSTATE = L4_MABX_P.Unit_Delay_28_InitialCondition;
30004 L4_MABX_DW.Unit_Delay_29_DSTATE = L4_MABX_P.Unit_Delay_29_InitialCondition;
30005 L4_MABX_DW.Unit_Delay_3_DSTATE = L4_MABX_P.Unit_Delay_3_InitialCondition_f;
30006 L4_MABX_DW.Unit_Delay_30_DSTATE = L4_MABX_P.Unit_Delay_30_InitialCondition;
30007 L4_MABX_DW.Unit_Delay_31_DSTATE = L4_MABX_P.Unit_Delay_31_InitialCondition;
30008 L4_MABX_DW.Unit_Delay_32_DSTATE = L4_MABX_P.Unit_Delay_32_InitialCondition;
30009 L4_MABX_DW.Unit_Delay_33_DSTATE = L4_MABX_P.Unit_Delay_33_InitialCondition;
30010 L4_MABX_DW.Unit_Delay_34_DSTATE = L4_MABX_P.Unit_Delay_34_InitialCondition;
30011 L4_MABX_DW.Unit_Delay_35_DSTATE = L4_MABX_P.Unit_Delay_35_InitialCondition;
30012 L4_MABX_DW.Unit_Delay_36_DSTATE = L4_MABX_P.Unit_Delay_36_InitialCondition;
30013 L4_MABX_DW.Unit_Delay_37_DSTATE = L4_MABX_P.Unit_Delay_37_InitialCondition;
30014 L4_MABX_DW.Unit_Delay_38_DSTATE = L4_MABX_P.Unit_Delay_38_InitialCondition;
30015 L4_MABX_DW.Unit_Delay_39_DSTATE = L4_MABX_P.Unit_Delay_39_InitialCondition;
30016 L4_MABX_DW.Unit_Delay_4_DSTATE = L4_MABX_P.Unit_Delay_4_InitialCondition;
30017 L4_MABX_DW.Unit_Delay_40_DSTATE = L4_MABX_P.Unit_Delay_40_InitialCondition;
30018 L4_MABX_DW.Unit_Delay_41_DSTATE = L4_MABX_P.Unit_Delay_41_InitialCondition;
30019 L4_MABX_DW.Unit_Delay_42_DSTATE = L4_MABX_P.Unit_Delay_42_InitialCondition;
30020 L4_MABX_DW.Unit_Delay_43_DSTATE = L4_MABX_P.Unit_Delay_43_InitialCondition;
30021 L4_MABX_DW.Unit_Delay_44_DSTATE = L4_MABX_P.Unit_Delay_44_InitialCondition;
30022 L4_MABX_DW.Unit_Delay_46_DSTATE = L4_MABX_P.Unit_Delay_46_InitialCondition;
30023 L4_MABX_DW.Unit_Delay_49_DSTATE = L4_MABX_P.Unit_Delay_49_InitialCondition;
30024 L4_MABX_DW.Unit_Delay_5_DSTATE = L4_MABX_P.Unit_Delay_5_InitialCondition;
30025 L4_MABX_DW.Unit_Delay_50_DSTATE = L4_MABX_P.Unit_Delay_50_InitialCondition;
30026 L4_MABX_DW.Unit_Delay_51_DSTATE = L4_MABX_P.Unit_Delay_51_InitialCondition;
30027 L4_MABX_DW.Unit_Delay_52_DSTATE = L4_MABX_P.Unit_Delay_52_InitialCondition;
30028 L4_MABX_DW.Unit_Delay_53_DSTATE = L4_MABX_P.Unit_Delay_53_InitialCondition;
30029 L4_MABX_DW.Unit_Delay_54_DSTATE = L4_MABX_P.Unit_Delay_54_InitialCondition;
30030 L4_MABX_DW.Unit_Delay_55_DSTATE = L4_MABX_P.Unit_Delay_55_InitialCondition;
30031 L4_MABX_DW.Unit_Delay_56_DSTATE = L4_MABX_P.Unit_Delay_56_InitialCondition;
30032 L4_MABX_DW.Unit_Delay_57_DSTATE = L4_MABX_P.Unit_Delay_57_InitialCondition;
30033 L4_MABX_DW.Unit_Delay_58_DSTATE = L4_MABX_P.Unit_Delay_58_InitialCondition;
30034 L4_MABX_DW.Unit_Delay_59_DSTATE = L4_MABX_P.Unit_Delay_59_InitialCondition;
30035 L4_MABX_DW.Unit_Delay_6_DSTATE = L4_MABX_P.Unit_Delay_6_InitialCondition;
30036 L4_MABX_DW.Unit_Delay_60_DSTATE = L4_MABX_P.Unit_Delay_60_InitialCondition;
30037 L4_MABX_DW.Unit_Delay_61_DSTATE = L4_MABX_P.Unit_Delay_61_InitialCondition;
30038 L4_MABX_DW.Unit_Delay_62_DSTATE = L4_MABX_P.Unit_Delay_62_InitialCondition;
30039 L4_MABX_DW.Unit_Delay_63_DSTATE = L4_MABX_P.Unit_Delay_63_InitialCondition;
30040 L4_MABX_DW.Unit_Delay_64_DSTATE = L4_MABX_P.Unit_Delay_64_InitialCondition;
30041 L4_MABX_DW.Unit_Delay_65_DSTATE = L4_MABX_P.Unit_Delay_65_InitialCondition;
30042 L4_MABX_DW.Unit_Delay_66_DSTATE = L4_MABX_P.Unit_Delay_66_InitialCondition;
30043 L4_MABX_DW.Unit_Delay_67_DSTATE = L4_MABX_P.Unit_Delay_67_InitialCondition;
30044 L4_MABX_DW.Unit_Delay_68_DSTATE = L4_MABX_P.Unit_Delay_68_InitialCondition;
30045 L4_MABX_DW.Unit_Delay_69_DSTATE = L4_MABX_P.Unit_Delay_69_InitialCondition;
30046 L4_MABX_DW.Unit_Delay_7_DSTATE = L4_MABX_P.Unit_Delay_7_InitialCondition;
30047 L4_MABX_DW.Unit_Delay_70_DSTATE = L4_MABX_P.Unit_Delay_70_InitialCondition;
30048 L4_MABX_DW.Unit_Delay_71_DSTATE = L4_MABX_P.Unit_Delay_71_InitialCondition;
30049 L4_MABX_DW.Unit_Delay_72_DSTATE = L4_MABX_P.Unit_Delay_72_InitialCondition;
30050 L4_MABX_DW.Unit_Delay_73_DSTATE = L4_MABX_P.Unit_Delay_73_InitialCondition;
30051 L4_MABX_DW.Unit_Delay_74_DSTATE = L4_MABX_P.Unit_Delay_74_InitialCondition;
30052 L4_MABX_DW.Unit_Delay_75_DSTATE = L4_MABX_P.Unit_Delay_75_InitialCondition;
30053 L4_MABX_DW.Unit_Delay_76_DSTATE = L4_MABX_P.Unit_Delay_76_InitialCondition;
30054 L4_MABX_DW.Unit_Delay_77_DSTATE = L4_MABX_P.Unit_Delay_77_InitialCondition;
30055 L4_MABX_DW.Unit_Delay_78_DSTATE = L4_MABX_P.Unit_Delay_78_InitialCondition;
30056 L4_MABX_DW.Unit_Delay_79_DSTATE = L4_MABX_P.Unit_Delay_79_InitialCondition;
30057 L4_MABX_DW.Unit_Delay_8_DSTATE = L4_MABX_P.Unit_Delay_8_InitialCondition;
30058 L4_MABX_DW.Unit_Delay_82_DSTATE = L4_MABX_P.Unit_Delay_82_InitialCondition;
30059 L4_MABX_DW.Unit_Delay_85_DSTATE = L4_MABX_P.Unit_Delay_85_InitialCondition;
30060 L4_MABX_DW.Unit_Delay_86_DSTATE = L4_MABX_P.Unit_Delay_86_InitialCondition;
30061 L4_MABX_DW.Unit_Delay_87_DSTATE = L4_MABX_P.Unit_Delay_87_InitialCondition;
30062 L4_MABX_DW.Unit_Delay_88_DSTATE = L4_MABX_P.Unit_Delay_88_InitialCondition;
30063 L4_MABX_DW.Unit_Delay_89_DSTATE = L4_MABX_P.Unit_Delay_89_InitialCondition;
30064 L4_MABX_DW.Unit_Delay_9_DSTATE = L4_MABX_P.Unit_Delay_9_InitialCondition;
30065 L4_MABX_DW.Unit_Delay_90_DSTATE = L4_MABX_P.Unit_Delay_90_InitialCondition;
30066 L4_MABX_DW.Unit_Delay_91_DSTATE = L4_MABX_P.Unit_Delay_91_InitialCondition;
30067 L4_MABX_DW.Unit_Delay_92_DSTATE = L4_MABX_P.Unit_Delay_92_InitialCondition;
30068 L4_MABX_DW.Unit_Delay_93_DSTATE = L4_MABX_P.Unit_Delay_93_InitialCondition;
30069 L4_MABX_DW.Unit_Delay_94_DSTATE = L4_MABX_P.Unit_Delay_94_InitialCondition;
30070 L4_MABX_DW.Unit_Delay_95_DSTATE = L4_MABX_P.Unit_Delay_95_InitialCondition;
30071 L4_MABX_DW.Unit_Delay_96_DSTATE = L4_MABX_P.Unit_Delay_96_InitialCondition;
30072 L4_MABX_DW.Unit_Delay_97_DSTATE = L4_MABX_P.Unit_Delay_97_InitialCondition;
30073 L4_MABX_DW.Unit_Delay_98_DSTATE = L4_MABX_P.Unit_Delay_98_InitialCondition;
30074 L4_MABX_DW.Unit_Delay_99_DSTATE = L4_MABX_P.Unit_Delay_99_InitialCondition;
30075
30076 /* InitializeConditions for UnitDelay: '<S649>/Unit_Delay2' */
30077 L4_MABX_DW.Unit_Delay2_DSTATE_k = L4_MABX_P.Unit_Delay2_InitialCondition_c;
30078
30079 /* InitializeConditions for UnitDelay: '<S649>/Unit_Delay1' */
30080 L4_MABX_DW.Unit_Delay1_DSTATE_p = L4_MABX_P.Unit_Delay1_InitialCondition_b;
30081
30082 /* InitializeConditions for UnitDelay: '<S656>/Unit_Delay' */
30083 L4_MABX_DW.Unit_Delay_DSTATE_g1 = L4_MABX_P.Unit_Delay_InitialCondition_ep;
30084
30085 /* InitializeConditions for UnitDelay: '<S747>/Delay Input1' */
30086 L4_MABX_DW.DelayInput1_DSTATE_o = L4_MABX_P.DetectRisePositive_vinit_e;
30087
30088 /* InitializeConditions for UnitDelay: '<S748>/Unit Delay' */
30089 L4_MABX_DW.UnitDelay_DSTATE_e = L4_MABX_P.UnitDelay_InitialCondition_a;
30090
30091 /* InitializeConditions for UnitDelay: '<S742>/Unit Delay' */
30092 L4_MABX_DW.UnitDelay_DSTATE_dy = L4_MABX_P.UnitDelay_InitialCondition_d;
30093
30094 /* InitializeConditions for UnitDelay: '<S746>/Delay Input1' */
30095 L4_MABX_DW.DelayInput1_DSTATE_h = L4_MABX_P.DetectFallNonpositive_vinit_l;
30096
30097 /* InitializeConditions for UnitDelay: '<S748>/Unit Delay1' */
30098 L4_MABX_DW.UnitDelay1_DSTATE_c = L4_MABX_P.UnitDelay1_InitialCondition_k;
30099
30100 /* InitializeConditions for UnitDelay: '<S749>/Unit Delay' */
30101 L4_MABX_DW.UnitDelay_DSTATE_j = L4_MABX_P.UnitDelay_InitialCondition_p;
30102
30103 /* InitializeConditions for UnitDelay: '<S749>/Unit Delay1' */
30104 L4_MABX_DW.UnitDelay1_DSTATE_c2 = L4_MABX_P.UnitDelay1_InitialCondition_pw;
30105
30106 /* InitializeConditions for UnitDelay: '<S10>/Unit_Delay' */
30107 L4_MABX_DW.Unit_Delay_DSTATE_do = L4_MABX_P.Unit_Delay_InitialCondition_jp;
30108
30109 /* SystemInitialize for Enabled SubSystem: '<S497>/AIR1' */
30110 /* SystemInitialize for Outport: '<S498>/PneumaticSupplyPress' */
30111 L4_MABX_B.SFunction1_o1_p0 = L4_MABX_P.PneumaticSupplyPress_Y0;
30112
30113 /* SystemInitialize for Outport: '<S498>/ParkingAnd_orTrailerAirPress' */
30114 L4_MABX_B.SFunction1_o2_or = L4_MABX_P.ParkingAnd_orTrailerAirPress_Y0;
30115
30116 /* SystemInitialize for Outport: '<S498>/ServiceBrakeCircuit1AirPress' */
30117 L4_MABX_B.SFunction1_o3_cv = L4_MABX_P.ServiceBrakeCircuit1AirPress_Y0;
30118
30119 /* SystemInitialize for Outport: '<S498>/ServiceBrakeCircuit2AirPress' */
30120 L4_MABX_B.SFunction1_o4_gt = L4_MABX_P.ServiceBrakeCircuit2AirPress_Y0;
30121
30122 /* SystemInitialize for Outport: '<S498>/AuxEquipmentSupplyPress' */
30123 L4_MABX_B.SFunction1_o5_he = L4_MABX_P.AuxEquipmentSupplyPress_Y0;
30124
30125 /* SystemInitialize for Outport: '<S498>/AirSuspensionSupplyPress' */
30126 L4_MABX_B.SFunction1_o6_hl = L4_MABX_P.AirSuspensionSupplyPress_Y0;
30127
30128 /* SystemInitialize for Outport: '<S498>/AirCompressorStatus' */
30129 L4_MABX_B.SFunction1_o7_lu = L4_MABX_P.AirCompressorStatus_Y0;
30130
30131 /* SystemInitialize for Outport: '<S498>/PowertrainCircuitAirSupplyPress' */
30132 L4_MABX_B.SFunction1_o8_oa = L4_MABX_P.PowertrainCircuitAirSupplyPress;
30133
30134 /* SystemInitialize for Outport: '<S498>/RX status' */
30135 L4_MABX_B.SFunction1_o9_n = L4_MABX_P.RXstatus_Y0_d;
30136
30137 /* SystemInitialize for Outport: '<S498>/RX time' */
30138 L4_MABX_B.SFunction1_o10_nt = L4_MABX_P.RXtime_Y0_k;
30139
30140 /* SystemInitialize for Outport: '<S498>/RX delta time' */
30141 L4_MABX_B.SFunction1_o11_jy = L4_MABX_P.RXdeltatime_Y0_jl;
30142
30143 /* End of SystemInitialize for SubSystem: '<S497>/AIR1' */
30144
30145 /* SystemInitialize for Enabled SubSystem: '<S499>/AMB' */
30146 /* SystemInitialize for Outport: '<S500>/BarometricPress' */
30147 L4_MABX_B.SFunction1_o1_nb = L4_MABX_P.BarometricPress_Y0;
30148
30149 /* SystemInitialize for Outport: '<S500>/CabInteriorTemp' */
30150 L4_MABX_B.SFunction1_o2_dg5 = L4_MABX_P.CabInteriorTemp_Y0;
30151
30152 /* SystemInitialize for Outport: '<S500>/AmbientAirTemp' */
30153 L4_MABX_B.SFunction1_o3_ip = L4_MABX_P.AmbientAirTemp_Y0;
30154
30155 /* SystemInitialize for Outport: '<S500>/EngAirIntakeTemp' */
30156 L4_MABX_B.SFunction1_o4_ci = L4_MABX_P.EngAirIntakeTemp_Y0;
30157
30158 /* SystemInitialize for Outport: '<S500>/RoadSurfaceTemp' */
30159 L4_MABX_B.SFunction1_o5_lo = L4_MABX_P.RoadSurfaceTemp_Y0;
30160
30161 /* SystemInitialize for Outport: '<S500>/RX status' */
30162 L4_MABX_B.SFunction1_o6_e = L4_MABX_P.RXstatus_Y0_db;
30163
30164 /* SystemInitialize for Outport: '<S500>/RX time' */
30165 L4_MABX_B.SFunction1_o7_ie = L4_MABX_P.RXtime_Y0_b;
30166
30167 /* SystemInitialize for Outport: '<S500>/RX delta time' */
30168 L4_MABX_B.SFunction1_o8_fs = L4_MABX_P.RXdeltatime_Y0_k;
30169
30170 /* End of SystemInitialize for SubSystem: '<S499>/AMB' */
30171
30172 /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_1000ms' */
30173 /* SystemInitialize for Enabled SubSystem: '<S869>/AIR1' */
30174 /* SystemInitialize for Outport: '<S870>/TX status' */
30175 L4_MABX_B.SFunction1_o1_i = L4_MABX_P.TXstatus_Y0;
30176
30177 /* SystemInitialize for Outport: '<S870>/TX time' */
30178 L4_MABX_B.SFunction1_o2_jb = L4_MABX_P.TXtime_Y0;
30179
30180 /* SystemInitialize for Outport: '<S870>/TX delta time' */
30181 L4_MABX_B.SFunction1_o3_a = L4_MABX_P.TXdeltatime_Y0;
30182
30183 /* SystemInitialize for Outport: '<S870>/TX delay time' */
30184 L4_MABX_B.SFunction1_o4_i = L4_MABX_P.TXdelaytime_Y0;
30185
30186 /* End of SystemInitialize for SubSystem: '<S869>/AIR1' */
30187
30188 /* SystemInitialize for Enabled SubSystem: '<S877>/AMB' */
30189 /* SystemInitialize for Outport: '<S878>/TX status' */
30190 L4_MABX_B.SFunction1_o1_lh = L4_MABX_P.TXstatus_Y0_o;
30191
30192 /* SystemInitialize for Outport: '<S878>/TX time' */
30193 L4_MABX_B.SFunction1_o2_og = L4_MABX_P.TXtime_Y0_p;
30194
30195 /* SystemInitialize for Outport: '<S878>/TX delta time' */
30196 L4_MABX_B.SFunction1_o3_nw3 = L4_MABX_P.TXdeltatime_Y0_p;
30197
30198 /* SystemInitialize for Outport: '<S878>/TX delay time' */
30199 L4_MABX_B.SFunction1_o4_dn = L4_MABX_P.TXdelaytime_Y0_g;
30200
30201 /* End of SystemInitialize for SubSystem: '<S877>/AMB' */
30202 /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_1000ms' */
30203
30204 /* SystemInitialize for Chart: '<S845>/Chart' */
30205 L4_MABX_DW.is_active_c5_SUB_ECU_L4_MABX_HW = 0U;
30206 L4_MABX_DW.is_c5_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_ACTIVE_CHILD;
30207
30208 /* SystemInitialize for Chart: '<S763>/Health State Machine PWM Sensor 1' */
30209 L4_MABX_DW.is_FAILURE_DETECTED_p = L4_MABX_IN_NO_ACTIVE_CHILD;
30210 L4_MABX_DW.is_active_c9_SUB_ECU_L4_MABX_HW = 0U;
30211 L4_MABX_DW.is_c9_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_ACTIVE_CHILD;
30212
30213 /* SystemInitialize for Chart: '<S763>/Health State Machine PWM Sensor 2' */
30214 L4_MABX_DW.is_FAILURE_DETECTED = L4_MABX_IN_NO_ACTIVE_CHILD;
30215 L4_MABX_DW.is_active_c10_SUB_ECU_L4_MABX_H = 0U;
30216 L4_MABX_DW.is_c10_SUB_ECU_L4_MABX_HW_Inter = L4_MABX_IN_NO_ACTIVE_CHILD;
30217
30218 /* SystemInitialize for Enabled SubSystem: '<S744>/Slew_at_event' */
30219 /* InitializeConditions for UnitDelay: '<S838>/Unit_Delay' */
30220 L4_MABX_DW.Unit_Delay_DSTATE_m5 = L4_MABX_P.Unit_Delay_InitialCondition_ed;
30221
30222 /* InitializeConditions for UnitDelay: '<S839>/Unit_Delay' */
30223 L4_MABX_DW.Unit_Delay_DSTATE_ep = L4_MABX_P.Unit_Delay_InitialCondition_aj;
30224
30225 /* InitializeConditions for UnitDelay: '<S842>/FixPt Unit Delay2' */
30226 L4_MABX_DW.FixPtUnitDelay2_DSTATE_f =
30227 L4_MABX_P.FixPtUnitDelay2_InitialCondit_l;
30228
30229 /* InitializeConditions for UnitDelay: '<S842>/FixPt Unit Delay1' */
30230 L4_MABX_DW.FixPtUnitDelay1_DSTATE_b =
30231 L4_MABX_P.FixPtUnitDelay1_InitialCondit_k;
30232
30233 /* InitializeConditions for UnitDelay: '<S837>/Unit_Delay' */
30234 L4_MABX_DW.Unit_Delay_DSTATE_cg = L4_MABX_P.Unit_Delay_InitialCondition_had;
30235
30236 /* SystemInitialize for Outport: '<S767>/F_Out_slewing' */
30237 L4_MABX_B.LogicalOperator_b4 = L4_MABX_P.F_Out_slewing_Y0_c;
30238
30239 /* SystemInitialize for Outport: '<S767>/Out' */
30240 L4_MABX_B.If_Then_Else_f1.Switch = L4_MABX_P.Out_Y0_f;
30241
30242 /* End of SystemInitialize for SubSystem: '<S744>/Slew_at_event' */
30243
30244 /* SystemInitialize for Enabled SubSystem: '<S507>/CCVS1_31' */
30245 /* SystemInitialize for Outport: '<S508>/TwoSpeedAxleSwitch' */
30246 L4_MABX_B.SFunction1_o1_em = L4_MABX_P.TwoSpeedAxleSwitch_Y0_e;
30247
30248 /* SystemInitialize for Outport: '<S508>/ParkingBrakeSwitch' */
30249 L4_MABX_B.SFunction1_o2_gh = L4_MABX_P.ParkingBrakeSwitch_Y0_n;
30250
30251 /* SystemInitialize for Outport: '<S508>/CruiseCtrlPauseSwitch' */
30252 L4_MABX_B.SFunction1_o3_kk = L4_MABX_P.CruiseCtrlPauseSwitch_Y0_d;
30253
30254 /* SystemInitialize for Outport: '<S508>/ParkBrakeReleaseInhibitRq' */
30255 L4_MABX_B.SFunction1_o4_pw = L4_MABX_P.ParkBrakeReleaseInhibitRq_Y0_k;
30256
30257 /* SystemInitialize for Outport: '<S508>/WheelBasedVehicleSpeed' */
30258 L4_MABX_B.SFunction1_o5_dz = L4_MABX_P.WheelBasedVehicleSpeed_Y0_a;
30259
30260 /* SystemInitialize for Outport: '<S508>/CruiseCtrlActive' */
30261 L4_MABX_B.SFunction1_o6_hc = L4_MABX_P.CruiseCtrlActive_Y0_c;
30262
30263 /* SystemInitialize for Outport: '<S508>/CruiseCtrlEnableSwitch' */
30264 L4_MABX_B.SFunction1_o7_au = L4_MABX_P.CruiseCtrlEnableSwitch_Y0_i;
30265
30266 /* SystemInitialize for Outport: '<S508>/BrakeSwitch' */
30267 L4_MABX_B.SFunction1_o8_ct = L4_MABX_P.BrakeSwitch_Y0_n;
30268
30269 /* SystemInitialize for Outport: '<S508>/ClutchSwitch' */
30270 L4_MABX_B.SFunction1_o9_g3 = L4_MABX_P.ClutchSwitch_Y0_l;
30271
30272 /* SystemInitialize for Outport: '<S508>/CruiseCtrlSetSwitch' */
30273 L4_MABX_B.SFunction1_o10_nn = L4_MABX_P.CruiseCtrlSetSwitch_Y0_h;
30274
30275 /* SystemInitialize for Outport: '<S508>/CruiseCtrlCoastSwitch' */
30276 L4_MABX_B.SFunction1_o11_b = L4_MABX_P.CruiseCtrlCoastSwitch_Y0_l;
30277
30278 /* SystemInitialize for Outport: '<S508>/CruiseCtrlResumeSwitch' */
30279 L4_MABX_B.SFunction1_o12_d = L4_MABX_P.CruiseCtrlResumeSwitch_Y0_d;
30280
30281 /* SystemInitialize for Outport: '<S508>/CruiseCtrlAccelerateSwitch' */
30282 L4_MABX_B.SFunction1_o13_hi = L4_MABX_P.CruiseCtrlAccelerateSwitch_Y0_e;
30283
30284 /* SystemInitialize for Outport: '<S508>/CruiseCtrlSetSpeed' */
30285 L4_MABX_B.SFunction1_o14_px = L4_MABX_P.CruiseCtrlSetSpeed_Y0_l;
30286
30287 /* SystemInitialize for Outport: '<S508>/PTOGovernorState' */
30288 L4_MABX_B.SFunction1_o15_m = L4_MABX_P.PTOGovernorState_Y0_f;
30289
30290 /* SystemInitialize for Outport: '<S508>/CruiseCtrlStates' */
30291 L4_MABX_B.SFunction1_o16_lm = L4_MABX_P.CruiseCtrlStates_Y0_h;
30292
30293 /* SystemInitialize for Outport: '<S508>/EngIdleIncrementSwitch' */
30294 L4_MABX_B.SFunction1_o17_d = L4_MABX_P.EngIdleIncrementSwitch_Y0_m;
30295
30296 /* SystemInitialize for Outport: '<S508>/EngIdleDecrementSwitch' */
30297 L4_MABX_B.SFunction1_o18_d = L4_MABX_P.EngIdleDecrementSwitch_Y0_o;
30298
30299 /* SystemInitialize for Outport: '<S508>/EngTestModeSwitch' */
30300 L4_MABX_B.SFunction1_o19_d = L4_MABX_P.EngTestModeSwitch_Y0_o;
30301
30302 /* SystemInitialize for Outport: '<S508>/EngShutdownOverrideSwitch' */
30303 L4_MABX_B.SFunction1_o20_a = L4_MABX_P.EngShutdownOverrideSwitch_Y0_k;
30304
30305 /* SystemInitialize for Outport: '<S508>/RX status' */
30306 L4_MABX_B.SFunction1_o21_j = L4_MABX_P.RXstatus_Y0_de;
30307
30308 /* SystemInitialize for Outport: '<S508>/RX time' */
30309 L4_MABX_B.SFunction1_o22_a = L4_MABX_P.RXtime_Y0_a;
30310
30311 /* SystemInitialize for Outport: '<S508>/RX delta time' */
30312 L4_MABX_B.SFunction1_o23_n = L4_MABX_P.RXdeltatime_Y0_h;
30313
30314 /* End of SystemInitialize for SubSystem: '<S507>/CCVS1_31' */
30315
30316 /* SystemInitialize for Enabled SubSystem: '<S518>/EBC2_0B1' */
30317 /* SystemInitialize for Outport: '<S519>/FrontAxleSpeed' */
30318 L4_MABX_B.SFunction1_o1_ie = L4_MABX_P.FrontAxleSpeed_Y0;
30319
30320 /* SystemInitialize for Outport: '<S519>/RelativeSpeedFrontAxleLeftWheel' */
30321 L4_MABX_B.SFunction1_o2_js = L4_MABX_P.RelativeSpeedFrontAxleLeftWheel;
30322
30323 /* SystemInitialize for Outport: '<S519>/RlativeSpeedFrontAxleRightWheel' */
30324 L4_MABX_B.SFunction1_o3_a3 = L4_MABX_P.RlativeSpeedFrontAxleRightWheel;
30325
30326 /* SystemInitialize for Outport: '<S519>/RelativeSpeedRearAxle1LeftWheel' */
30327 L4_MABX_B.SFunction1_o4_o2 = L4_MABX_P.RelativeSpeedRearAxle1LeftWheel;
30328
30329 /* SystemInitialize for Outport: '<S519>/RlativeSpeedRearAxle1RightWheel' */
30330 L4_MABX_B.SFunction1_o5_co = L4_MABX_P.RlativeSpeedRearAxle1RightWheel;
30331
30332 /* SystemInitialize for Outport: '<S519>/RelativeSpeedRearAxle2LeftWheel' */
30333 L4_MABX_B.SFunction1_o6_j = L4_MABX_P.RelativeSpeedRearAxle2LeftWheel;
30334
30335 /* SystemInitialize for Outport: '<S519>/RlativeSpeedRearAxle2RightWheel' */
30336 L4_MABX_B.SFunction1_o7_b = L4_MABX_P.RlativeSpeedRearAxle2RightWheel;
30337
30338 /* SystemInitialize for Outport: '<S519>/RX status' */
30339 L4_MABX_B.SFunction1_o8_g = L4_MABX_P.RXstatus_Y0_l;
30340
30341 /* SystemInitialize for Outport: '<S519>/RX time' */
30342 L4_MABX_B.SFunction1_o9_cm = L4_MABX_P.RXtime_Y0_jo;
30343
30344 /* SystemInitialize for Outport: '<S519>/RX delta time' */
30345 L4_MABX_B.SFunction1_o10_ey = L4_MABX_P.RXdeltatime_Y0_n;
30346
30347 /* End of SystemInitialize for SubSystem: '<S518>/EBC2_0B1' */
30348
30349 /* SystemInitialize for Enabled SubSystem: '<S576>/HRW_0B' */
30350 /* SystemInitialize for Outport: '<S577>/FrontAxleLeftWheelSpeed' */
30351 L4_MABX_B.SFunction1_o1_i4 = L4_MABX_P.FrontAxleLeftWheelSpeed_Y0;
30352
30353 /* SystemInitialize for Outport: '<S577>/FrontAxleRightWheelSpeed' */
30354 L4_MABX_B.SFunction1_o2_da = L4_MABX_P.FrontAxleRightWheelSpeed_Y0;
30355
30356 /* SystemInitialize for Outport: '<S577>/RearAxleLeftWheelSpeed' */
30357 L4_MABX_B.SFunction1_o3_p1 = L4_MABX_P.RearAxleLeftWheelSpeed_Y0;
30358
30359 /* SystemInitialize for Outport: '<S577>/RearAxleRightWheelSpeed' */
30360 L4_MABX_B.SFunction1_o4_aj = L4_MABX_P.RearAxleRightWheelSpeed_Y0;
30361
30362 /* SystemInitialize for Outport: '<S577>/RX status' */
30363 L4_MABX_B.SFunction1_o5_b0 = L4_MABX_P.RXstatus_Y0_pe;
30364
30365 /* SystemInitialize for Outport: '<S577>/RX time' */
30366 L4_MABX_B.SFunction1_o6_a = L4_MABX_P.RXtime_Y0_cb;
30367
30368 /* SystemInitialize for Outport: '<S577>/RX delta time' */
30369 L4_MABX_B.SFunction1_o7_j = L4_MABX_P.RXdeltatime_Y0_dk;
30370
30371 /* End of SystemInitialize for SubSystem: '<S576>/HRW_0B' */
30372
30373 /* SystemInitialize for Enabled SubSystem: '<S516>/EBC1_0B' */
30374 /* SystemInitialize for Outport: '<S517>/ASREngCtrlActive' */
30375 L4_MABX_B.SFunction1_o1_mb = L4_MABX_P.ASREngCtrlActive_Y0_m;
30376
30377 /* SystemInitialize for Outport: '<S517>/ASRBrakeCtrlActive' */
30378 L4_MABX_B.SFunction1_o2_i1 = L4_MABX_P.ASRBrakeCtrlActive_Y0_l;
30379
30380 /* SystemInitialize for Outport: '<S517>/AntiLockBrakingActive' */
30381 L4_MABX_B.SFunction1_o3_ac = L4_MABX_P.AntiLockBrakingActive_Y0_f;
30382
30383 /* SystemInitialize for Outport: '<S517>/EBSBrakeSwitch' */
30384 L4_MABX_B.SFunction1_o4_oc = L4_MABX_P.EBSBrakeSwitch_Y0_j;
30385
30386 /* SystemInitialize for Outport: '<S517>/BrakePedalPos' */
30387 L4_MABX_B.SFunction1_o5_md = L4_MABX_P.BrakePedalPos_Y0_j;
30388
30389 /* SystemInitialize for Outport: '<S517>/ABSOffroadSwitch' */
30390 L4_MABX_B.SFunction1_o6_oc = L4_MABX_P.ABSOffroadSwitch_Y0_l;
30391
30392 /* SystemInitialize for Outport: '<S517>/ASROffroadSwitch' */
30393 L4_MABX_B.SFunction1_o7_d = L4_MABX_P.ASROffroadSwitch_Y0_o;
30394
30395 /* SystemInitialize for Outport: '<S517>/ASRHillHolderSwitch' */
30396 L4_MABX_B.SFunction1_o8_l1 = L4_MABX_P.ASRHillHolderSwitch_Y0_a;
30397
30398 /* SystemInitialize for Outport: '<S517>/TractionCtrlOverrideSwitch' */
30399 L4_MABX_B.SFunction1_o9_lw = L4_MABX_P.TractionCtrlOverrideSwitch_Y0_b;
30400
30401 /* SystemInitialize for Outport: '<S517>/AccelInterlockSwitch' */
30402 L4_MABX_B.SFunction1_o10_h = L4_MABX_P.AccelInterlockSwitch_Y0_m;
30403
30404 /* SystemInitialize for Outport: '<S517>/EngDerateSwitch' */
30405 L4_MABX_B.SFunction1_o11_ay = L4_MABX_P.EngDerateSwitch_Y0_j;
30406
30407 /* SystemInitialize for Outport: '<S517>/EngAuxShutdownSwitch' */
30408 L4_MABX_B.SFunction1_o12_j = L4_MABX_P.EngAuxShutdownSwitch_Y0_f;
30409
30410 /* SystemInitialize for Outport: '<S517>/RemoteAccelEnableSwitch' */
30411 L4_MABX_B.SFunction1_o13_gt = L4_MABX_P.RemoteAccelEnableSwitch_Y0_o;
30412
30413 /* SystemInitialize for Outport: '<S517>/EngRetarderSelection' */
30414 L4_MABX_B.SFunction1_o14_h = L4_MABX_P.EngRetarderSelection_Y0_h;
30415
30416 /* SystemInitialize for Outport: '<S517>/ABSFullyOperational' */
30417 L4_MABX_B.SFunction1_o15_k = L4_MABX_P.ABSFullyOperational_Y0_f;
30418
30419 /* SystemInitialize for Outport: '<S517>/EBSRedWarningSignal' */
30420 L4_MABX_B.SFunction1_o16_l = L4_MABX_P.EBSRedWarningSignal_Y0_i;
30421
30422 /* SystemInitialize for Outport: '<S517>/ABS_EBSAmberWarningSignal' */
30423 L4_MABX_B.SFunction1_o17_m = L4_MABX_P.ABS_EBSAmberWarningSignal_Y0_a;
30424
30425 /* SystemInitialize for Outport: '<S517>/ATC_ASRInformationSignal' */
30426 L4_MABX_B.SFunction1_o18_j = L4_MABX_P.ATC_ASRInformationSignal_Y0_h;
30427
30428 /* SystemInitialize for Outport: '<S517>/SrcAddrssOfCtrllngDvcFrBrkCntrl' */
30429 L4_MABX_B.SFunction1_o19_h = L4_MABX_P.SrcAddrssOfCtrllngDvcFrBrkCnt_b;
30430
30431 /* SystemInitialize for Outport: '<S517>/HaltBrakeSwitch' */
30432 L4_MABX_B.SFunction1_o20_j = L4_MABX_P.HaltBrakeSwitch_Y0_i;
30433
30434 /* SystemInitialize for Outport: '<S517>/TrailerABSStatus' */
30435 L4_MABX_B.SFunction1_o21_p = L4_MABX_P.TrailerABSStatus_Y0_i;
30436
30437 /* SystemInitialize for Outport: '<S517>/TrctrMntdTrilerABSWarningSignal' */
30438 L4_MABX_B.SFunction1_o22_e = L4_MABX_P.TrctrMntdTrilerABSWarningSign_e;
30439
30440 /* SystemInitialize for Outport: '<S517>/RX status' */
30441 L4_MABX_B.SFunction1_o23_i = L4_MABX_P.RXstatus_Y0_j;
30442
30443 /* SystemInitialize for Outport: '<S517>/RX time' */
30444 L4_MABX_B.SFunction1_o24_a = L4_MABX_P.RXtime_Y0_dr;
30445
30446 /* SystemInitialize for Outport: '<S517>/RX delta time' */
30447 L4_MABX_B.SFunction1_o25_p = L4_MABX_P.RXdeltatime_Y0_a2;
30448
30449 /* End of SystemInitialize for SubSystem: '<S516>/EBC1_0B' */
30450
30451 /* SystemInitialize for Enabled SubSystem: '<S571>/ETC2_031' */
30452 /* SystemInitialize for Outport: '<S572>/SPN524_TransSelectedGear' */
30453 L4_MABX_B.SFunction1_o1_lx = L4_MABX_P.SPN524_TransSelectedGear_Y0;
30454
30455 /* SystemInitialize for Outport: '<S572>/SPN526_TransActualGearRatio' */
30456 L4_MABX_B.SFunction1_o2_fb = L4_MABX_P.SPN526_TransActualGearRatio_Y0;
30457
30458 /* SystemInitialize for Outport: '<S572>/SPN523_TransCurrentGear' */
30459 L4_MABX_B.SFunction1_o3_js = L4_MABX_P.SPN523_TransCurrentGear_Y0;
30460
30461 /* SystemInitialize for Outport: '<S572>/RX status' */
30462 L4_MABX_B.SFunction1_o4_b3 = L4_MABX_P.RXstatus_Y0_da;
30463
30464 /* SystemInitialize for Outport: '<S572>/RX time' */
30465 L4_MABX_B.SFunction1_o5_lx = L4_MABX_P.RXtime_Y0_h2;
30466
30467 /* SystemInitialize for Outport: '<S572>/RX delta time' */
30468 L4_MABX_B.SFunction1_o6_m = L4_MABX_P.RXdeltatime_Y0_hk;
30469
30470 /* End of SystemInitialize for SubSystem: '<S571>/ETC2_031' */
30471
30472 /* SystemInitialize for Enabled SubSystem: '<S565>/EEC1_001' */
30473 /* SystemInitialize for Outport: '<S566>/EngTorqueMode' */
30474 L4_MABX_B.SFunction1_o1_mp = L4_MABX_P.EngTorqueMode_Y0;
30475
30476 /* SystemInitialize for Outport: '<S566>/ActlEngPrcntTrqueHighResolution' */
30477 L4_MABX_B.SFunction1_o2_a4 = L4_MABX_P.ActlEngPrcntTrqueHighResolution;
30478
30479 /* SystemInitialize for Outport: '<S566>/DriversDemandEngPercentTorque' */
30480 L4_MABX_B.SFunction1_o3_ob = L4_MABX_P.DriversDemandEngPercentTorque_Y;
30481
30482 /* SystemInitialize for Outport: '<S566>/ActualEngPercentTorque' */
30483 L4_MABX_B.SFunction1_o4_jr = L4_MABX_P.ActualEngPercentTorque_Y0;
30484
30485 /* SystemInitialize for Outport: '<S566>/EngSpeed' */
30486 L4_MABX_B.SFunction1_o5_en = L4_MABX_P.EngSpeed_Y0;
30487
30488 /* SystemInitialize for Outport: '<S566>/SrcAddrssOfCtrllngDvcFrEngCntrl' */
30489 L4_MABX_B.SFunction1_o6_cv = L4_MABX_P.SrcAddrssOfCtrllngDvcFrEngCntrl;
30490
30491 /* SystemInitialize for Outport: '<S566>/EngStarterMode' */
30492 L4_MABX_B.SFunction1_o7_ny = L4_MABX_P.EngStarterMode_Y0;
30493
30494 /* SystemInitialize for Outport: '<S566>/EngDemandPercentTorque' */
30495 L4_MABX_B.SFunction1_o8_ab = L4_MABX_P.EngDemandPercentTorque_Y0;
30496
30497 /* SystemInitialize for Outport: '<S566>/RX status' */
30498 L4_MABX_B.SFunction1_o9_px = L4_MABX_P.RXstatus_Y0_hj;
30499
30500 /* SystemInitialize for Outport: '<S566>/RX time' */
30501 L4_MABX_B.SFunction1_o10_ft = L4_MABX_P.RXtime_Y0_a1;
30502
30503 /* SystemInitialize for Outport: '<S566>/RX delta time' */
30504 L4_MABX_B.SFunction1_o11_g = L4_MABX_P.RXdeltatime_Y0_pa;
30505
30506 /* End of SystemInitialize for SubSystem: '<S565>/EEC1_001' */
30507
30508 /* SystemInitialize for Enabled SubSystem: '<S569>/EEC3_001' */
30509 /* SystemInitialize for Outport: '<S570>/SPN514_NominalFrictionPercentTorque' */
30510 L4_MABX_B.SFunction1_o1_nn = L4_MABX_P.SPN514_NominalFrictionPercentTo;
30511
30512 /* SystemInitialize for Outport: '<S570>/SPN2978_EstEngParasiticLossesPercentTorque' */
30513 L4_MABX_B.SFunction1_o2_mg = L4_MABX_P.SPN2978_EstEngParasiticLossesPe;
30514
30515 /* SystemInitialize for Outport: '<S570>/RX status' */
30516 L4_MABX_B.SFunction1_o3_ji = L4_MABX_P.RXstatus_Y0_i;
30517
30518 /* SystemInitialize for Outport: '<S570>/RX time' */
30519 L4_MABX_B.SFunction1_o4_lp = L4_MABX_P.RXtime_Y0_lf;
30520
30521 /* SystemInitialize for Outport: '<S570>/RX delta time' */
30522 L4_MABX_B.SFunction1_o5_gf = L4_MABX_P.RXdeltatime_Y0_dz;
30523
30524 /* End of SystemInitialize for SubSystem: '<S569>/EEC3_001' */
30525
30526 /* SystemInitialize for Enabled SubSystem: '<S512>/CVW_0B1' */
30527 /* SystemInitialize for Outport: '<S513>/SPN1760_GrossCombinationVehicleWeight' */
30528 L4_MABX_B.SFunction1_o1_am = L4_MABX_P.SPN1760_GrossCombinationVehicle;
30529
30530 /* SystemInitialize for Outport: '<S513>/RX status' */
30531 L4_MABX_B.SFunction1_o2_ap = L4_MABX_P.RXstatus_Y0_n;
30532
30533 /* SystemInitialize for Outport: '<S513>/RX time' */
30534 L4_MABX_B.SFunction1_o3_dd = L4_MABX_P.RXtime_Y0_p;
30535
30536 /* SystemInitialize for Outport: '<S513>/RX delta time' */
30537 L4_MABX_B.SFunction1_o4_ii = L4_MABX_P.RXdeltatime_Y0_pb;
30538
30539 /* End of SystemInitialize for SubSystem: '<S512>/CVW_0B1' */
30540
30541 /* SystemInitialize for Enabled SubSystem: '<S493>/ACC1_2A_' */
30542 /* SystemInitialize for Outport: '<S494>/SpeedOfForwardVehicle' */
30543 L4_MABX_B.SFunction1_o1_lz = L4_MABX_P.SpeedOfForwardVehicle_Y0;
30544
30545 /* SystemInitialize for Outport: '<S494>/DistanceToForwardVehicle' */
30546 L4_MABX_B.SFunction1_o2_cq = L4_MABX_P.DistanceToForwardVehicle_Y0;
30547
30548 /* SystemInitialize for Outport: '<S494>/AdaptiveCruiseCtrlSetSpeed' */
30549 L4_MABX_B.SFunction1_o3_ew = L4_MABX_P.AdaptiveCruiseCtrlSetSpeed_Y0;
30550
30551 /* SystemInitialize for Outport: '<S494>/AdaptiveCruiseCtrlMode' */
30552 L4_MABX_B.SFunction1_o4_jvw = L4_MABX_P.AdaptiveCruiseCtrlMode_Y0;
30553
30554 /* SystemInitialize for Outport: '<S494>/AdptveCruiseCtrlSetDistanceMode' */
30555 L4_MABX_B.SFunction1_o5_p3 = L4_MABX_P.AdptveCruiseCtrlSetDistanceMode;
30556
30557 /* SystemInitialize for Outport: '<S494>/RoadCurvature' */
30558 L4_MABX_B.SFunction1_o6_jd = L4_MABX_P.RoadCurvature_Y0;
30559
30560 /* SystemInitialize for Outport: '<S494>/ACCTargetDetected' */
30561 L4_MABX_B.SFunction1_o7_p = L4_MABX_P.ACCTargetDetected_Y0;
30562
30563 /* SystemInitialize for Outport: '<S494>/ACCSystemShutoffWarning' */
30564 L4_MABX_B.SFunction1_o8_o1 = L4_MABX_P.ACCSystemShutoffWarning_Y0;
30565
30566 /* SystemInitialize for Outport: '<S494>/ACCDistanceAlertSignal' */
30567 L4_MABX_B.SFunction1_o9_f = L4_MABX_P.ACCDistanceAlertSignal_Y0;
30568
30569 /* SystemInitialize for Outport: '<S494>/ForwardCollisionWarning' */
30570 L4_MABX_B.SFunction1_o10_cg = L4_MABX_P.ForwardCollisionWarning_Y0;
30571
30572 /* SystemInitialize for Outport: '<S494>/RX status' */
30573 L4_MABX_B.SFunction1_o11_e = L4_MABX_P.RXstatus_Y0_g;
30574
30575 /* SystemInitialize for Outport: '<S494>/RX time' */
30576 L4_MABX_B.SFunction1_o12_ag = L4_MABX_P.RXtime_Y0_n;
30577
30578 /* SystemInitialize for Outport: '<S494>/RX delta time' */
30579 L4_MABX_B.SFunction1_o13_i = L4_MABX_P.RXdeltatime_Y0_e;
30580
30581 /* End of SystemInitialize for SubSystem: '<S493>/ACC1_2A_' */
30582
30583 /* SystemInitialize for Enabled SubSystem: '<S475>/CAN_TYPE1_RX_M1_C1' */
30584 /* SystemInitialize for Outport: '<S477>/byte1' */
30585 L4_MABX_B.SFunction1_o1_en = L4_MABX_P.byte1_Y0;
30586
30587 /* SystemInitialize for Outport: '<S477>/byte2' */
30588 L4_MABX_B.SFunction1_o2_cm = L4_MABX_P.byte2_Y0;
30589
30590 /* SystemInitialize for Outport: '<S477>/byte3' */
30591 L4_MABX_B.SFunction1_o3_ewi = L4_MABX_P.byte3_Y0;
30592
30593 /* SystemInitialize for Outport: '<S477>/byte4' */
30594 L4_MABX_B.SFunction1_o4_kw = L4_MABX_P.byte4_Y0;
30595
30596 /* SystemInitialize for Outport: '<S477>/byte5' */
30597 L4_MABX_B.SFunction1_o5_cp = L4_MABX_P.byte5_Y0;
30598
30599 /* SystemInitialize for Outport: '<S477>/byte6' */
30600 L4_MABX_B.SFunction1_o6_du = L4_MABX_P.byte6_Y0;
30601
30602 /* SystemInitialize for Outport: '<S477>/byte7' */
30603 L4_MABX_B.SFunction1_o7_mj = L4_MABX_P.byte7_Y0;
30604
30605 /* SystemInitialize for Outport: '<S477>/byte8' */
30606 L4_MABX_B.SFunction1_o8_k = L4_MABX_P.byte8_Y0;
30607
30608 /* SystemInitialize for Outport: '<S477>/RX status' */
30609 L4_MABX_B.SFunction1_o9_cg = L4_MABX_P.RXstatus_Y0;
30610
30611 /* SystemInitialize for Outport: '<S477>/RX time' */
30612 L4_MABX_B.SFunction1_o10_mb = L4_MABX_P.RXtime_Y0;
30613
30614 /* SystemInitialize for Outport: '<S477>/RX delta time' */
30615 L4_MABX_B.SFunction1_o11_hc = L4_MABX_P.RXdeltatime_Y0;
30616
30617 /* End of SystemInitialize for SubSystem: '<S475>/CAN_TYPE1_RX_M1_C1' */
30618
30619 /* SystemInitialize for Enabled SubSystem: '<S469>/Decode_TPCM_BAM' */
30620 /* SystemInitialize for Outport: '<S687>/Out' */
30621 L4_MABX_B.SPN2556_ControlByte_k = (uint8_T)L4_MABX_P.Out_Y0_h;
30622 L4_MABX_B.DataType_le1 = (uint16_T)L4_MABX_P.Out_Y0_h;
30623 L4_MABX_B.SPN2568_TotalNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_h;
30624 L4_MABX_B.DataType_ef = (uint32_T)L4_MABX_P.Out_Y0_h;
30625
30626 /* End of SystemInitialize for SubSystem: '<S469>/Decode_TPCM_BAM' */
30627
30628 /* SystemInitialize for Enabled SubSystem: '<S484>/CAN_TYPE1_RX_M1_C1' */
30629 /* SystemInitialize for Outport: '<S486>/byte1' */
30630 L4_MABX_B.SFunction1_o1_do = L4_MABX_P.byte1_Y0_l;
30631
30632 /* SystemInitialize for Outport: '<S486>/byte2' */
30633 L4_MABX_B.SFunction1_o2_m0 = L4_MABX_P.byte2_Y0_c;
30634
30635 /* SystemInitialize for Outport: '<S486>/byte3' */
30636 L4_MABX_B.SFunction1_o3_lm = L4_MABX_P.byte3_Y0_d;
30637
30638 /* SystemInitialize for Outport: '<S486>/byte4' */
30639 L4_MABX_B.SFunction1_o4_p5 = L4_MABX_P.byte4_Y0_c;
30640
30641 /* SystemInitialize for Outport: '<S486>/byte5' */
30642 L4_MABX_B.SFunction1_o5_ej = L4_MABX_P.byte5_Y0_h;
30643
30644 /* SystemInitialize for Outport: '<S486>/byte6' */
30645 L4_MABX_B.SFunction1_o6_p3d = L4_MABX_P.byte6_Y0_e;
30646
30647 /* SystemInitialize for Outport: '<S486>/byte7' */
30648 L4_MABX_B.SFunction1_o7_k4 = L4_MABX_P.byte7_Y0_l;
30649
30650 /* SystemInitialize for Outport: '<S486>/byte8' */
30651 L4_MABX_B.SFunction1_o8_n = L4_MABX_P.byte8_Y0_l;
30652
30653 /* SystemInitialize for Outport: '<S486>/RX status' */
30654 L4_MABX_B.SFunction1_o9_kq = L4_MABX_P.RXstatus_Y0_p;
30655
30656 /* SystemInitialize for Outport: '<S486>/RX time' */
30657 L4_MABX_B.SFunction1_o10_eo = L4_MABX_P.RXtime_Y0_h;
30658
30659 /* SystemInitialize for Outport: '<S486>/RX delta time' */
30660 L4_MABX_B.SFunction1_o11_k = L4_MABX_P.RXdeltatime_Y0_d;
30661
30662 /* End of SystemInitialize for SubSystem: '<S484>/CAN_TYPE1_RX_M1_C1' */
30663
30664 /* SystemInitialize for S-Function (rti_commonblock): '<S848>/S-Function1' incorporates:
30665 * SubSystem: '<S417>/IncrementTimer'
30666 */
30667 L4_MABX_IncrementTimer_Init();
30668
30669 /* End of SystemInitialize for S-Function (rti_commonblock): '<S848>/S-Function1' */
30670
30671 /* SystemInitialize for Enabled SubSystem: '<S436>/CAN_RX_EC1_00' */
30672 /* SystemInitialize for Enabled SubSystem: '<S520>/Decode' */
30673 /* InitializeConditions for UnitDelay: '<S523>/Unit_Delay' */
30674 L4_MABX_DW.Unit_Delay_DSTATE_a = L4_MABX_P.Unit_Delay_InitialCondition_bp;
30675 for (i = 0; i < 39; i++) {
30676 /* InitializeConditions for UnitDelay: '<S520>/Unit Delay' */
30677 L4_MABX_DW.UnitDelay_DSTATE_em[i] =
30678 L4_MABX_P.UnitDelay_InitialCondition_lf[i];
30679
30680 /* SystemInitialize for Outport: '<S523>/RawData' */
30681 L4_MABX_B.Inport_j[i] = L4_MABX_P.RawData_Y0;
30682 }
30683
30684 /* SystemInitialize for Outport: '<S523>/RX_time' */
30685 L4_MABX_B.timeStamp_c = L4_MABX_P.RX_time_Y0;
30686
30687 /* SystemInitialize for Outport: '<S523>/RX_delta_time' */
30688 L4_MABX_B.Subtract_f3 = L4_MABX_P.RX_delta_time_Y0;
30689
30690 /* End of SystemInitialize for SubSystem: '<S520>/Decode' */
30691
30692 /* SystemInitialize for Outport: '<S520>/RX_status' */
30693 L4_MABX_B.RX_status_di = L4_MABX_P.RX_status_Y0;
30694
30695 /* End of SystemInitialize for SubSystem: '<S436>/CAN_RX_EC1_00' */
30696
30697 /* SystemInitialize for Enabled SubSystem: '<S642>/VDC1_0B_' */
30698 /* SystemInitialize for Outport: '<S643>/VDCInformationSignal' */
30699 L4_MABX_B.SFunction1_o1_ol = L4_MABX_P.VDCInformationSignal_Y0;
30700
30701 /* SystemInitialize for Outport: '<S643>/VDCFullyOperational' */
30702 L4_MABX_B.SFunction1_o2_dm = L4_MABX_P.VDCFullyOperational_Y0;
30703
30704 /* SystemInitialize for Outport: '<S643>/VDCBrakeLightRq' */
30705 L4_MABX_B.SFunction1_o3_na = L4_MABX_P.VDCBrakeLightRq_Y0;
30706
30707 /* SystemInitialize for Outport: '<S643>/ROPEngCtrlActive' */
30708 L4_MABX_B.SFunction1_o4_o = L4_MABX_P.ROPEngCtrlActive_Y0;
30709
30710 /* SystemInitialize for Outport: '<S643>/ROPBrakeCtrlActive' */
30711 L4_MABX_B.SFunction1_o5_m = L4_MABX_P.ROPBrakeCtrlActive_Y0;
30712
30713 /* SystemInitialize for Outport: '<S643>/YCEngCtrlActive' */
30714 L4_MABX_B.SFunction1_o6_n = L4_MABX_P.YCEngCtrlActive_Y0;
30715
30716 /* SystemInitialize for Outport: '<S643>/YCBrakeCtrlActive' */
30717 L4_MABX_B.SFunction1_o7_f = L4_MABX_P.YCBrakeCtrlActive_Y0;
30718
30719 /* SystemInitialize for Outport: '<S643>/RX status' */
30720 L4_MABX_B.SFunction1_o8_a = L4_MABX_P.RXstatus_Y0_fuv;
30721
30722 /* SystemInitialize for Outport: '<S643>/RX time' */
30723 L4_MABX_B.SFunction1_o9_j = L4_MABX_P.RXtime_Y0_ev;
30724
30725 /* SystemInitialize for Outport: '<S643>/RX delta time' */
30726 L4_MABX_B.SFunction1_o10 = L4_MABX_P.RXdeltatime_Y0_g2;
30727
30728 /* End of SystemInitialize for SubSystem: '<S642>/VDC1_0B_' */
30729
30730 /* SystemInitialize for Enabled SubSystem: '<S644>/VDC2_0B1' */
30731 /* SystemInitialize for Outport: '<S645>/SteerWheelAngle' */
30732 SteerWheelAngle = L4_MABX_P.SteerWheelAngle_Y0;
30733
30734 /* SystemInitialize for Outport: '<S645>/SteerWheelTurnCounter' */
30735 L4_MABX_B.SFunction1_o2_i = L4_MABX_P.SteerWheelTurnCounter_Y0;
30736
30737 /* SystemInitialize for Outport: '<S645>/SteerWheelAngleSensorType' */
30738 L4_MABX_B.SFunction1_o3_a0 = L4_MABX_P.SteerWheelAngleSensorType_Y0;
30739
30740 /* SystemInitialize for Outport: '<S645>/YawRate' */
30741 YawRate = L4_MABX_P.YawRate_Y0;
30742
30743 /* SystemInitialize for Outport: '<S645>/LateralAcceleration' */
30744 L4_MABX_B.SFunction1_o5_f = L4_MABX_P.LateralAcceleration_Y0;
30745
30746 /* SystemInitialize for Outport: '<S645>/LongitudinalAcceleration' */
30747 SPN1810_LongitudinalAcceleration = L4_MABX_P.LongitudinalAcceleration_Y0;
30748
30749 /* SystemInitialize for Outport: '<S645>/RX status' */
30750 L4_MABX_B.SFunction1_o7_c = L4_MABX_P.RXstatus_Y0_hv;
30751
30752 /* SystemInitialize for Outport: '<S645>/RX time' */
30753 L4_MABX_B.SFunction1_o8_c = L4_MABX_P.RXtime_Y0_oz;
30754
30755 /* SystemInitialize for Outport: '<S645>/RX delta time' */
30756 L4_MABX_B.SFunction1_o9 = L4_MABX_P.RXdeltatime_Y0_o;
30757
30758 /* End of SystemInitialize for SubSystem: '<S644>/VDC2_0B1' */
30759
30760 /* SystemInitialize for Enabled SubSystem: '<S459>/CAN_RX_VI_00' */
30761 /* SystemInitialize for Enabled SubSystem: '<S648>/Decode' */
30762 /* InitializeConditions for UnitDelay: '<S651>/Unit_Delay' */
30763 L4_MABX_DW.Unit_Delay_DSTATE_e = L4_MABX_P.Unit_Delay_InitialCondition_js;
30764 for (i = 0; i < 17; i++) {
30765 /* InitializeConditions for UnitDelay: '<S648>/Unit Delay' */
30766 L4_MABX_DW.UnitDelay_DSTATE_a[i] =
30767 L4_MABX_P.UnitDelay_InitialCondition_k[i];
30768
30769 /* SystemInitialize for Outport: '<S651>/RawData' */
30770 L4_MABX_B.Inport[i] = L4_MABX_P.RawData_Y0_b;
30771 }
30772
30773 /* SystemInitialize for Outport: '<S651>/RX_time' */
30774 L4_MABX_B.timeStamp = L4_MABX_P.RX_time_Y0_i;
30775
30776 /* SystemInitialize for Outport: '<S651>/RX_delta_time' */
30777 L4_MABX_B.Subtract_h3 = L4_MABX_P.RX_delta_time_Y0_m;
30778
30779 /* End of SystemInitialize for SubSystem: '<S648>/Decode' */
30780
30781 /* SystemInitialize for Outport: '<S648>/RX_status' */
30782 L4_MABX_B.RX_status_ez = L4_MABX_P.RX_status_Y0_e;
30783
30784 /* End of SystemInitialize for SubSystem: '<S459>/CAN_RX_VI_00' */
30785
30786 /* SystemInitialize for Enabled SubSystem: '<S630>/SSI2_031' */
30787 /* SystemInitialize for Outport: '<S631>/PitchAngleExRange' */
30788 L4_MABX_B.SFunction1_o1_f5 = L4_MABX_P.PitchAngleExRange_Y0;
30789
30790 /* SystemInitialize for Outport: '<S631>/RollAngleExRange' */
30791 L4_MABX_B.SFunction1_o2_gk = L4_MABX_P.RollAngleExRange_Y0;
30792
30793 /* SystemInitialize for Outport: '<S631>/PitchAngleExRangeCompensation' */
30794 L4_MABX_B.SFunction1_o3_aa = L4_MABX_P.PitchAngleExRangeCompensation_Y;
30795
30796 /* SystemInitialize for Outport: '<S631>/PitchAngleExRangeFigureOfMerit' */
30797 L4_MABX_B.SFunction1_o4_p0 = L4_MABX_P.PitchAngleExRangeFigureOfMerit_;
30798
30799 /* SystemInitialize for Outport: '<S631>/RollAngleExRangeCompensation' */
30800 L4_MABX_B.SFunction1_o5_k = L4_MABX_P.RollAngleExRangeCompensation_Y0;
30801
30802 /* SystemInitialize for Outport: '<S631>/RollAngleExRangeFigureOfMerit' */
30803 L4_MABX_B.SFunction1_o6_i = L4_MABX_P.RollAngleExRangeFigureOfMerit_Y;
30804
30805 /* SystemInitialize for Outport: '<S631>/RllAndPtchExRngMsurementLatency' */
30806 L4_MABX_B.SFunction1_o7_o = L4_MABX_P.RllAndPtchExRngMsurementLatency;
30807
30808 /* SystemInitialize for Outport: '<S631>/RX status' */
30809 L4_MABX_B.SFunction1_o8_lw = L4_MABX_P.RXstatus_Y0_ps;
30810
30811 /* SystemInitialize for Outport: '<S631>/RX time' */
30812 L4_MABX_B.SFunction1_o9_m = L4_MABX_P.RXtime_Y0_lz;
30813
30814 /* SystemInitialize for Outport: '<S631>/RX delta time' */
30815 L4_MABX_B.SFunction1_o10_l = L4_MABX_P.RXdeltatime_Y0_nn;
30816
30817 /* End of SystemInitialize for SubSystem: '<S630>/SSI2_031' */
30818
30819 /* SystemInitialize for Enabled SubSystem: '<S621>/PX2_LanePosEst' */
30820 /* SystemInitialize for Outport: '<S624>/PX2_LanePosEstAngle' */
30821 L4_MABX_B.SFunction1_o1_m = L4_MABX_P.PX2_LanePosEstAngle_Y0;
30822
30823 /* SystemInitialize for Outport: '<S624>/PX2_LanePosEstNumPoints' */
30824 L4_MABX_B.SFunction1_o2_kz = L4_MABX_P.PX2_LanePosEstNumPoints_Y0;
30825
30826 /* SystemInitialize for Outport: '<S624>/PX2_LanePosEstPosition' */
30827 L4_MABX_B.SFunction1_o3_on = L4_MABX_P.PX2_LanePosEstPosition_Y0;
30828
30829 /* SystemInitialize for Outport: '<S624>/PX2_LanePosEstNumLanes' */
30830 L4_MABX_B.SFunction1_o4_ke = L4_MABX_P.PX2_LanePosEstNumLanes_Y0;
30831
30832 /* SystemInitialize for Outport: '<S624>/RX status' */
30833 L4_MABX_B.SFunction1_o5_h = L4_MABX_P.RXstatus_Y0_hqw;
30834
30835 /* SystemInitialize for Outport: '<S624>/RX time' */
30836 L4_MABX_B.SFunction1_o6_pv = L4_MABX_P.RXtime_Y0_dty;
30837
30838 /* SystemInitialize for Outport: '<S624>/RX delta time' */
30839 L4_MABX_B.SFunction1_o7_k = L4_MABX_P.RXdeltatime_Y0_cl;
30840
30841 /* End of SystemInitialize for SubSystem: '<S621>/PX2_LanePosEst' */
30842
30843 /* SystemInitialize for Enabled SubSystem: '<S628>/Bendix_Prop2C2_Status_30' */
30844 /* SystemInitialize for Outport: '<S629>/PressureP4' */
30845 L4_MABX_B.SFunction1_o1_kq = L4_MABX_P.PressureP4_Y0;
30846
30847 /* SystemInitialize for Outport: '<S629>/PressureP1' */
30848 L4_MABX_B.SFunction1_o2_gr = L4_MABX_P.PressureP1_Y0;
30849
30850 /* SystemInitialize for Outport: '<S629>/PressureP21' */
30851 L4_MABX_B.SFunction1_o3_pd = L4_MABX_P.PressureP21_Y0;
30852
30853 /* SystemInitialize for Outport: '<S629>/PressureP22' */
30854 L4_MABX_B.SFunction1_o4_jgy = L4_MABX_P.PressureP22_Y0;
30855
30856 /* SystemInitialize for Outport: '<S629>/PressureP42' */
30857 L4_MABX_B.SFunction1_o5_c = L4_MABX_P.PressureP42_Y0;
30858
30859 /* SystemInitialize for Outport: '<S629>/XPR1ControlStatus' */
30860 L4_MABX_B.SFunction1_o6_p = L4_MABX_P.XPR1ControlStatus_Y0;
30861
30862 /* SystemInitialize for Outport: '<S629>/XPR2ControlStatus' */
30863 L4_MABX_B.SFunction1_o7_av = L4_MABX_P.XPR2ControlStatus_Y0;
30864
30865 /* SystemInitialize for Outport: '<S629>/XPR3ControlStatus' */
30866 L4_MABX_B.SFunction1_o8_cu = L4_MABX_P.XPR3ControlStatus_Y0;
30867
30868 /* SystemInitialize for Outport: '<S629>/XPRErrorState' */
30869 L4_MABX_B.SFunction1_o9_i = L4_MABX_P.XPRErrorState_Y0;
30870
30871 /* SystemInitialize for Outport: '<S629>/XPRControlMode' */
30872 L4_MABX_B.SFunction1_o10_n = L4_MABX_P.XPRControlMode_Y0;
30873
30874 /* SystemInitialize for Outport: '<S629>/RX status' */
30875 L4_MABX_B.SFunction1_o11_j = L4_MABX_P.RXstatus_Y0_ox;
30876
30877 /* SystemInitialize for Outport: '<S629>/RX time' */
30878 L4_MABX_B.SFunction1_o12_g = L4_MABX_P.RXtime_Y0_ph;
30879
30880 /* SystemInitialize for Outport: '<S629>/RX delta time' */
30881 L4_MABX_B.SFunction1_o13_g = L4_MABX_P.RXdeltatime_Y0_b1;
30882
30883 /* End of SystemInitialize for SubSystem: '<S628>/Bendix_Prop2C2_Status_30' */
30884
30885 /* SystemInitialize for Enabled SubSystem: '<S578>/PropB_REAX_2_13' */
30886 /* SystemInitialize for Outport: '<S580>/PropB_REAX_2_ActualHandwheelPos' */
30887 L4_MABX_B.SFunction1_o1_cc = L4_MABX_P.PropB_REAX_2_ActualHandwheelPos;
30888
30889 /* SystemInitialize for Outport: '<S580>/PropB_REAX_2_EchoedStrWhlPos' */
30890 L4_MABX_B.SFunction1_o2_kb = L4_MABX_P.PropB_REAX_2_EchoedStrWhlPos_Y0;
30891
30892 /* SystemInitialize for Outport: '<S580>/RX status' */
30893 L4_MABX_B.SFunction1_o3_b = L4_MABX_P.RXstatus_Y0_hq;
30894
30895 /* SystemInitialize for Outport: '<S580>/RX time' */
30896 L4_MABX_B.SFunction1_o4_hf = L4_MABX_P.RXtime_Y0_ak;
30897
30898 /* SystemInitialize for Outport: '<S580>/RX delta time' */
30899 L4_MABX_B.SFunction1_o5_pr = L4_MABX_P.RXdeltatime_Y0_pf;
30900
30901 /* End of SystemInitialize for SubSystem: '<S578>/PropB_REAX_2_13' */
30902
30903 /* SystemInitialize for Enabled SubSystem: '<S579>/PropB_REAX_2_13' */
30904 /* SystemInitialize for Outport: '<S581>/PropB_REAX_2_ActualHandwheelPos' */
30905 L4_MABX_B.SFunction1_o1_gm = L4_MABX_P.PropB_REAX_2_ActualHandwheelP_k;
30906
30907 /* SystemInitialize for Outport: '<S581>/PropB_REAX_2_EchoedStrWhlPos' */
30908 L4_MABX_B.SFunction1_o2_jh = L4_MABX_P.PropB_REAX_2_EchoedStrWhlPos__c;
30909
30910 /* SystemInitialize for Outport: '<S581>/RX status' */
30911 L4_MABX_B.SFunction1_o3_ep = L4_MABX_P.RXstatus_Y0_dem;
30912
30913 /* SystemInitialize for Outport: '<S581>/RX time' */
30914 L4_MABX_B.SFunction1_o4_bl = L4_MABX_P.RXtime_Y0_pe;
30915
30916 /* SystemInitialize for Outport: '<S581>/RX delta time' */
30917 L4_MABX_B.SFunction1_o5_my = L4_MABX_P.RXdeltatime_Y0_ab;
30918
30919 /* End of SystemInitialize for SubSystem: '<S579>/PropB_REAX_2_13' */
30920
30921 /* SystemInitialize for Atomic SubSystem: '<S65>/Task_10ms' */
30922 /* InitializeConditions for UnitDelay: '<S97>/Unit Delay1' */
30923 L4_MABX_DW.UnitDelay1_DSTATE_m = L4_MABX_P.UnitDelay1_InitialCondition;
30924
30925 /* InitializeConditions for UnitDelay: '<S76>/Unit_Delay' */
30926 L4_MABX_DW.Unit_Delay_DSTATE_fv = L4_MABX_P.Unit_Delay_InitialCondition_jn;
30927
30928 /* InitializeConditions for UnitDelay: '<S98>/Delay Input1' */
30929 L4_MABX_DW.DelayInput1_DSTATE_d = L4_MABX_P.DetectFallNonpositive_vinit;
30930
30931 /* InitializeConditions for UnitDelay: '<S97>/Unit Delay' */
30932 L4_MABX_DW.UnitDelay_DSTATE_b1 = L4_MABX_P.UnitDelay_InitialCondition_b;
30933
30934 /* InitializeConditions for RateTransition: '<S81>/TmpRTBAtSignal Conversion1Inport1' */
30935 L4_MABX_DW.TmpRTBAtSignalConversion1Inport =
30936 L4_MABX_P.TmpRTBAtSignalConversion1Inport;
30937
30938 /* InitializeConditions for UnitDelay: '<S389>/Unit_Delay' */
30939 L4_MABX_DW.Unit_Delay_DSTATE_cx = L4_MABX_P.Unit_Delay_InitialCondition_b1;
30940
30941 /* InitializeConditions for UnitDelay: '<S390>/Unit_Delay' */
30942 L4_MABX_DW.Unit_Delay_DSTATE_d0 = L4_MABX_P.Unit_Delay_InitialCondition_gz;
30943
30944 /* InitializeConditions for UnitDelay: '<S347>/Unit_Delay' */
30945 L4_MABX_DW.Unit_Delay_DSTATE_ef = L4_MABX_P.Unit_Delay_InitialCondition_i;
30946
30947 /* InitializeConditions for UnitDelay: '<S394>/FixPt Unit Delay2' */
30948 L4_MABX_DW.FixPtUnitDelay2_DSTATE_a =
30949 L4_MABX_P.FixPtUnitDelay2_InitialCondi_f5;
30950
30951 /* InitializeConditions for UnitDelay: '<S394>/FixPt Unit Delay1' */
30952 L4_MABX_DW.FixPtUnitDelay1_DSTATE_hj =
30953 L4_MABX_P.FixPtUnitDelay1_InitialCondit_l;
30954
30955 /* InitializeConditions for UnitDelay: '<S391>/Unit_Delay' */
30956 L4_MABX_DW.Unit_Delay_DSTATE_m = L4_MABX_P.Unit_Delay_InitialCondition_hae;
30957
30958 /* InitializeConditions for UnitDelay: '<S378>/Unit_Delay' */
30959 L4_MABX_DW.Unit_Delay_DSTATE_iy = L4_MABX_P.Unit_Delay_InitialCondition_a;
30960
30961 /* InitializeConditions for UnitDelay: '<S379>/Unit_Delay' */
30962 L4_MABX_DW.Unit_Delay_DSTATE_mv = L4_MABX_P.Unit_Delay_InitialCondition_gt;
30963
30964 /* InitializeConditions for UnitDelay: '<S345>/Unit_Delay' */
30965 L4_MABX_DW.Unit_Delay_DSTATE_g = L4_MABX_P.Unit_Delay_InitialCondition_fb;
30966
30967 /* InitializeConditions for UnitDelay: '<S383>/FixPt Unit Delay2' */
30968 L4_MABX_DW.FixPtUnitDelay2_DSTATE_ip =
30969 L4_MABX_P.FixPtUnitDelay2_InitialCondi_po;
30970
30971 /* InitializeConditions for UnitDelay: '<S383>/FixPt Unit Delay1' */
30972 L4_MABX_DW.FixPtUnitDelay1_DSTATE_hq =
30973 L4_MABX_P.FixPtUnitDelay1_InitialCondit_d;
30974
30975 /* InitializeConditions for UnitDelay: '<S380>/Unit_Delay' */
30976 L4_MABX_DW.Unit_Delay_DSTATE_b = L4_MABX_P.Unit_Delay_InitialCondition_c;
30977
30978 /* InitializeConditions for RateTransition: '<S81>/TmpRTBAtSignal Conversion3Inport1' */
30979 L4_MABX_DW.TmpRTBAtSignalConversion3Inport =
30980 L4_MABX_P.TmpRTBAtSignalConversion3Inport;
30981
30982 /* InitializeConditions for RateTransition: '<S81>/TmpRTBAtSignal Conversion2Inport1' */
30983 L4_MABX_DW.TmpRTBAtSignalConversion2Inport =
30984 L4_MABX_P.TmpRTBAtSignalConversion2Inport;
30985
30986 /* InitializeConditions for UnitDelay: '<S360>/Unit_Delay' */
30987 L4_MABX_DW.Unit_Delay_DSTATE_bw = L4_MABX_P.Unit_Delay_InitialCondition_e;
30988
30989 /* InitializeConditions for UnitDelay: '<S362>/Unit_Delay' */
30990 L4_MABX_DW.Unit_Delay_DSTATE_ko = L4_MABX_P.Unit_Delay_InitialCondition_ml;
30991
30992 /* InitializeConditions for UnitDelay: '<S371>/FixPt Unit Delay2' */
30993 L4_MABX_DW.FixPtUnitDelay2_DSTATE_fh =
30994 L4_MABX_P.FixPtUnitDelay2_InitialCondit_i;
30995
30996 /* InitializeConditions for UnitDelay: '<S371>/FixPt Unit Delay1' */
30997 L4_MABX_DW.FixPtUnitDelay1_DSTATE_l =
30998 L4_MABX_P.FixPtUnitDelay1_InitialCondit_h;
30999
31000 /* InitializeConditions for UnitDelay: '<S369>/Unit_Delay' */
31001 L4_MABX_DW.Unit_Delay_DSTATE_p = L4_MABX_P.Unit_Delay_InitialCondition_j;
31002
31003 /* InitializeConditions for UnitDelay: '<S342>/Delay Input1' */
31004 L4_MABX_DW.DelayInput1_DSTATE[0] = L4_MABX_P.DetectChange1_vinit;
31005
31006 /* InitializeConditions for UnitDelay: '<S349>/Delay Input1' */
31007 L4_MABX_DW.DelayInput1_DSTATE_f[0] = L4_MABX_P.DetectChange1_vinit_n;
31008
31009 /* InitializeConditions for UnitDelay: '<S342>/Delay Input1' */
31010 L4_MABX_DW.DelayInput1_DSTATE[1] = L4_MABX_P.DetectChange1_vinit;
31011
31012 /* InitializeConditions for UnitDelay: '<S349>/Delay Input1' */
31013 L4_MABX_DW.DelayInput1_DSTATE_f[1] = L4_MABX_P.DetectChange1_vinit_n;
31014
31015 /* InitializeConditions for UnitDelay: '<S351>/Unit_Delay' */
31016 L4_MABX_DW.Unit_Delay_DSTATE_la = L4_MABX_P.Unit_Delay_InitialCondition_ag;
31017
31018 /* InitializeConditions for UnitDelay: '<S355>/FixPt Unit Delay2' */
31019 L4_MABX_DW.FixPtUnitDelay2_DSTATE_c =
31020 L4_MABX_P.FixPtUnitDelay2_InitialCondi_ck;
31021
31022 /* InitializeConditions for UnitDelay: '<S355>/FixPt Unit Delay1' */
31023 L4_MABX_DW.FixPtUnitDelay1_DSTATE_ej =
31024 L4_MABX_P.FixPtUnitDelay1_InitialCondit_m;
31025
31026 /* InitializeConditions for UnitDelay: '<S350>/Unit_Delay' */
31027 L4_MABX_DW.Unit_Delay_1_DSTATE_j = L4_MABX_P.Unit_Delay_1_InitialCondition;
31028 L4_MABX_DW.Unit_Delay_2_DSTATE_e = L4_MABX_P.Unit_Delay_2_InitialCondition;
31029 L4_MABX_DW.Unit_Delay_3_DSTATE_j = L4_MABX_P.Unit_Delay_3_InitialCondition;
31030
31031 /* InitializeConditions for UnitDelay: '<S348>/Unit_Delay' */
31032 L4_MABX_DW.Unit_Delay_DSTATE_f = L4_MABX_P.Unit_Delay_InitialCondition_e2;
31033
31034 /* InitializeConditions for UnitDelay: '<S107>/Unit_Delay' */
31035 L4_MABX_DW.Unit_Delay_DSTATE_eu4 = L4_MABX_P.Unit_Delay_InitialCondition_ip;
31036
31037 /* InitializeConditions for UnitDelay: '<S203>/Unit_Delay1' */
31038 L4_MABX_DW.Unit_Delay1_DSTATE_d = L4_MABX_P.Unit_Delay1_InitialCondition_f;
31039
31040 /* InitializeConditions for UnitDelay: '<S203>/Unit_Delay2' */
31041 L4_MABX_DW.Unit_Delay2_DSTATE_e = L4_MABX_P.Unit_Delay2_InitialCondition_a;
31042
31043 /* InitializeConditions for UnitDelay: '<S202>/UD' */
31044 L4_MABX_DW.UD_DSTATE = L4_MABX_P.DiscreteDerivative1_ICPrevScale;
31045
31046 /* InitializeConditions for UnitDelay: '<S327>/Unit_Delay1' */
31047 L4_MABX_DW.Unit_Delay1_DSTATE_db = L4_MABX_P.Unit_Delay1_InitialCondition_m;
31048
31049 /* InitializeConditions for UnitDelay: '<S327>/Unit_Delay2' */
31050 L4_MABX_DW.Unit_Delay2_DSTATE_d = L4_MABX_P.Unit_Delay2_InitialCondition_g;
31051
31052 /* InitializeConditions for UnitDelay: '<S326>/Delay Input1' */
31053 L4_MABX_DW.DelayInput1_DSTATE_f0 = L4_MABX_P.DetectChange_vinit;
31054
31055 /* InitializeConditions for UnitDelay: '<S328>/Unit_Delay1' */
31056 L4_MABX_DW.Unit_Delay1_DSTATE_a = L4_MABX_P.Unit_Delay1_InitialCondition_ps;
31057
31058 /* InitializeConditions for UnitDelay: '<S328>/Unit_Delay2' */
31059 L4_MABX_DW.Unit_Delay2_DSTATE_i = L4_MABX_P.Unit_Delay2_InitialCondition_ji;
31060
31061 /* InitializeConditions for UnitDelay: '<S329>/Unit_Delay1' */
31062 L4_MABX_DW.Unit_Delay1_DSTATE_p3 = L4_MABX_P.Unit_Delay1_InitialCondition_j;
31063
31064 /* InitializeConditions for UnitDelay: '<S329>/Unit_Delay2' */
31065 L4_MABX_DW.Unit_Delay2_DSTATE_p = L4_MABX_P.Unit_Delay2_InitialCondition_ap;
31066
31067 /* InitializeConditions for UnitDelay: '<S285>/Unit Delay' */
31068 L4_MABX_DW.UnitDelay_DSTATE_d = L4_MABX_P.UnitDelay_InitialCondition_c;
31069
31070 /* InitializeConditions for UnitDelay: '<S295>/Unit Delay' */
31071 L4_MABX_DW.UnitDelay_DSTATE_ml = L4_MABX_P.UnitDelay_InitialCondition;
31072
31073 /* InitializeConditions for UnitDelay: '<S296>/Unit Delay' */
31074 L4_MABX_DW.UnitDelay_DSTATE_m0 = L4_MABX_P.UnitDelay_InitialCondition_g;
31075
31076 /* InitializeConditions for UnitDelay: '<S296>/Unit Delay1' */
31077 L4_MABX_DW.UnitDelay1_DSTATE_k = L4_MABX_P.UnitDelay1_InitialCondition_j;
31078
31079 /* InitializeConditions for RateTransition: '<S80>/TmpRTBAtrad2deg1Inport1' */
31080 L4_MABX_DW.TmpRTBAtrad2deg1Inport1_Buffer0 =
31081 L4_MABX_P.TmpRTBAtrad2deg1Inport1_Initial;
31082
31083 /* InitializeConditions for RateTransition: '<S80>/TmpRTBAtsignCurveOffsetInport1' */
31084 L4_MABX_DW.TmpRTBAtsignCurveOffsetInport1_ =
31085 L4_MABX_P.TmpRTBAtsignCurveOffsetInport1_;
31086
31087 /* InitializeConditions for UnitDelay: '<S290>/Unit Delay' */
31088 L4_MABX_DW.UnitDelay_DSTATE_m1 = L4_MABX_P.UnitDelay_InitialCondition_e;
31089
31090 /* InitializeConditions for RateTransition: '<S284>/TmpRTBAtAdd2Inport2' */
31091 L4_MABX_DW.TmpRTBAtAdd2Inport2_Buffer0 =
31092 L4_MABX_P.TmpRTBAtAdd2Inport2_InitialCond;
31093
31094 /* InitializeConditions for UnitDelay: '<S308>/Delay Input2' */
31095 L4_MABX_DW.DelayInput2_DSTATE = L4_MABX_P.DelayInput2_InitialCondition;
31096
31097 /* InitializeConditions for DiscreteIntegrator: '<S307>/Integrator' */
31098 L4_MABX_DW.Integrator_DSTATE = L4_MABX_P.Integrator_IC;
31099 L4_MABX_DW.Integrator_PrevResetState = 2;
31100
31101 /* InitializeConditions for DiscreteIntegrator: '<S307>/Filter' */
31102 L4_MABX_DW.Filter_DSTATE = L4_MABX_P.Filter_IC;
31103 L4_MABX_DW.Filter_PrevResetState = 2;
31104
31105 /* InitializeConditions for UnitDelay: '<S311>/Delay Input' */
31106 L4_MABX_DW.DelayInput_DSTATE = L4_MABX_P.TransferFcnLeadorLag_ICPrevInpu;
31107
31108 /* InitializeConditions for UnitDelay: '<S311>/Delay Output' */
31109 L4_MABX_DW.DelayOutput_DSTATE = L4_MABX_P.TransferFcnLeadorLag_ICPrevOutp;
31110
31111 /* InitializeConditions for UnitDelay: '<S309>/Delay Input2' */
31112 L4_MABX_DW.DelayInput2_DSTATE_a = L4_MABX_P.DelayInput2_InitialCondition_m;
31113
31114 /* InitializeConditions for DiscreteIntegrator: '<S301>/Discrete-Time Integrator' */
31115 L4_MABX_DW.DiscreteTimeIntegrator_IC_LOADI = 1U;
31116 L4_MABX_DW.DiscreteTimeIntegrator_PrevRese = 2;
31117
31118 /* InitializeConditions for UnitDelay: '<S321>/Delay Input2' */
31119 L4_MABX_DW.DelayInput2_DSTATE_l = L4_MABX_P.DelayInput2_InitialCondition_g;
31120
31121 /* InitializeConditions for DiscreteIntegrator: '<S80>/Discrete-Time Integrator' */
31122 L4_MABX_DW.DiscreteTimeIntegrator_DSTATE_e =
31123 L4_MABX_P.DiscreteTimeIntegrator_IC;
31124 L4_MABX_DW.DiscreteTimeIntegrator_PrevRe_e = 0;
31125
31126 /* InitializeConditions for RateLimiter: '<S310>/Limit Rate Limiter' */
31127 L4_MABX_DW.PrevY = L4_MABX_P.LimitRateLimiter_IC;
31128
31129 /* InitializeConditions for UnitDelay: '<S80>/Unit Delay' */
31130 L4_MABX_DW.UnitDelay_DSTATE_e3 = L4_MABX_P.UnitDelay_InitialCondition_g1;
31131
31132 /* InitializeConditions for UnitDelay: '<S373>/FixPt Unit Delay2' */
31133 L4_MABX_DW.FixPtUnitDelay2_DSTATE_aw =
31134 L4_MABX_P.FixPtUnitDelay2_InitialCondit_g;
31135
31136 /* InitializeConditions for UnitDelay: '<S373>/FixPt Unit Delay1' */
31137 L4_MABX_DW.FixPtUnitDelay1_DSTATE_pe =
31138 L4_MABX_P.FixPtUnitDelay1_InitialCondi_dl;
31139
31140 /* InitializeConditions for UnitDelay: '<S374>/FixPt Unit Delay2' */
31141 L4_MABX_DW.FixPtUnitDelay2_DSTATE_g =
31142 L4_MABX_P.FixPtUnitDelay2_InitialCondi_pz;
31143
31144 /* InitializeConditions for UnitDelay: '<S374>/FixPt Unit Delay1' */
31145 L4_MABX_DW.FixPtUnitDelay1_DSTATE_g =
31146 L4_MABX_P.FixPtUnitDelay1_InitialCondi_ol;
31147
31148 /* InitializeConditions for UnitDelay: '<S368>/Unit_Delay' */
31149 L4_MABX_DW.Unit_Delay_DSTATE_j = L4_MABX_P.Unit_Delay_InitialCondition_b;
31150
31151 /* SystemInitialize for Enabled SubSystem: '<S79>/Throttle_controller_gov' */
31152 /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay1' */
31153 L4_MABX_DW.Unit_Delay1_DSTATE_p1 = L4_MABX_P.Unit_Delay1_InitialCondition_o;
31154
31155 /* InitializeConditions for UnitDelay: '<S220>/Unit_Delay' */
31156 L4_MABX_DW.Unit_Delay_DSTATE_lq = L4_MABX_P.Unit_Delay_InitialCondition_b2;
31157
31158 /* InitializeConditions for UnitDelay: '<S247>/Unit_Delay' */
31159 L4_MABX_DW.Unit_Delay_DSTATE_be = L4_MABX_P.Unit_Delay_InitialCondition_lj;
31160
31161 /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay1' */
31162 L4_MABX_DW.Unit_Delay1_DSTATE_h = L4_MABX_P.Unit_Delay1_InitialCondition_a;
31163
31164 /* InitializeConditions for UnitDelay: '<S268>/Unit_Delay' */
31165 L4_MABX_DW.Unit_Delay_DSTATE_fi = L4_MABX_P.Unit_Delay_InitialCondition_bm;
31166
31167 /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay2' */
31168 L4_MABX_DW.FixPtUnitDelay2_DSTATE_gq =
31169 L4_MABX_P.FixPtUnitDelay2_InitialCondit_a;
31170
31171 /* InitializeConditions for UnitDelay: '<S272>/FixPt Unit Delay1' */
31172 L4_MABX_DW.FixPtUnitDelay1_DSTATE_a =
31173 L4_MABX_P.FixPtUnitDelay1_InitialCondit_o;
31174
31175 /* InitializeConditions for UnitDelay: '<S267>/Unit_Delay2' */
31176 L4_MABX_DW.Unit_Delay2_DSTATE_m = L4_MABX_P.Unit_Delay2_InitialCondition_j;
31177
31178 /* InitializeConditions for UnitDelay: '<S222>/Unit_Delay' */
31179 L4_MABX_DW.Unit_Delay_DSTATE_fz = L4_MABX_P.Unit_Delay_InitialCondition_kg;
31180
31181 /* SystemInitialize for Enabled SubSystem: '<S244>/Calculate_D_term' */
31182 L4_MA_Calculate_D_term_Init(&L4_MABX_B.Calculate_D_term_h,
31183 &L4_MABX_DW.Calculate_D_term_h, &L4_MABX_P.Calculate_D_term_h);
31184
31185 /* End of SystemInitialize for SubSystem: '<S244>/Calculate_D_term' */
31186
31187 /* SystemInitialize for Enabled SubSystem: '<S244>/Calculate_I_term' */
31188 L4_MA_Calculate_I_term_Init(&L4_MABX_B.Calculate_I_term_n,
31189 &L4_MABX_DW.Calculate_I_term_n, &L4_MABX_P.Calculate_I_term_n);
31190
31191 /* End of SystemInitialize for SubSystem: '<S244>/Calculate_I_term' */
31192
31193 /* SystemInitialize for Outport: '<S212>/PID_output' */
31194 L4_MABX_B.If_Then_Else_pi.Switch = L4_MABX_P.PID_output_Y0_c;
31195
31196 /* SystemInitialize for Outport: '<S212>/PID_output_unlim' */
31197 L4_MABX_B.Add_ds = L4_MABX_P.PID_output_unlim_Y0;
31198
31199 /* SystemInitialize for Outport: '<S212>/PID_control_error' */
31200 L4_MABX_B.If_Then_Else_k.Switch = L4_MABX_P.PID_control_error_Y0;
31201
31202 /* SystemInitialize for Outport: '<S212>/PID_p_term' */
31203 L4_MABX_B.Product_i = L4_MABX_P.PID_p_term_Y0;
31204
31205 /* SystemInitialize for Outport: '<S212>/PID_i_term' */
31206 L4_MABX_B.PID_i_term_c = L4_MABX_P.PID_i_term_Y0;
31207
31208 /* SystemInitialize for Outport: '<S212>/PID_d_term' */
31209 L4_MABX_B.PID_d_term_c = L4_MABX_P.PID_d_term_Y0;
31210
31211 /* SystemInitialize for Outport: '<S212>/PID_hold_i_term_f' */
31212 L4_MABX_B.PID_hold_i_term_f_b = L4_MABX_P.PID_hold_i_term_f_Y0;
31213
31214 /* End of SystemInitialize for SubSystem: '<S79>/Throttle_controller_gov' */
31215
31216 /* SystemInitialize for Enabled SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */
31217 /* InitializeConditions for UnitDelay: '<S184>/Unit_Delay' */
31218 L4_MABX_DW.Unit_Delay_DSTATE_o = L4_MABX_P.Unit_Delay_InitialCondition_l;
31219
31220 /* InitializeConditions for UnitDelay: '<S194>/Unit_Delay' */
31221 L4_MABX_DW.Unit_Delay_DSTATE_ae = L4_MABX_P.Unit_Delay_InitialCondition_cl;
31222
31223 /* InitializeConditions for UnitDelay: '<S198>/FixPt Unit Delay2' */
31224 L4_MABX_DW.FixPtUnitDelay2_DSTATE_l =
31225 L4_MABX_P.FixPtUnitDelay2_InitialCondit_f;
31226
31227 /* InitializeConditions for UnitDelay: '<S198>/FixPt Unit Delay1' */
31228 L4_MABX_DW.FixPtUnitDelay1_DSTATE_d =
31229 L4_MABX_P.FixPtUnitDelay1_InitialCondit_j;
31230
31231 /* InitializeConditions for UnitDelay: '<S195>/Unit_Delay' */
31232 L4_MABX_DW.Unit_Delay_DSTATE_om = L4_MABX_P.Unit_Delay_InitialCondition_ha;
31233
31234 /* SystemInitialize for Outport: '<S184>/Shift_interlock_brake_press_target_kpa' */
31235 L4_MABX_B.If_Then_Else_il.Switch = L4_MABX_P.Shift_interlock_brake_press_tar;
31236
31237 /* SystemInitialize for Outport: '<S184>/F_Shift_interlock_conditions_met' */
31238 L4_MABX_B.F_Shift_interlock_conditions_me =
31239 L4_MABX_P.F_Shift_interlock_conditions_me;
31240
31241 /* End of SystemInitialize for SubSystem: '<S105>/Determine_shift_interlock_brake_pressure_target' */
31242
31243 /* SystemInitialize for Enabled SubSystem: '<S105>/Determine_brake_hold_pressure_target' */
31244 /* InitializeConditions for UnitDelay: '<S183>/Unit_Delay' */
31245 L4_MABX_DW.Unit_Delay_DSTATE_c = L4_MABX_P.Unit_Delay_InitialCondition_d;
31246
31247 /* InitializeConditions for UnitDelay: '<S187>/Unit_Delay' */
31248 L4_MABX_DW.Unit_Delay_DSTATE_or = L4_MABX_P.Unit_Delay_InitialCondition_fy;
31249
31250 /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay2' */
31251 L4_MABX_DW.FixPtUnitDelay2_DSTATE_je =
31252 L4_MABX_P.FixPtUnitDelay2_InitialCondit_e;
31253
31254 /* InitializeConditions for UnitDelay: '<S191>/FixPt Unit Delay1' */
31255 L4_MABX_DW.FixPtUnitDelay1_DSTATE_b0 =
31256 L4_MABX_P.FixPtUnitDelay1_InitialCondit_p;
31257
31258 /* InitializeConditions for UnitDelay: '<S188>/Unit_Delay' */
31259 L4_MABX_DW.Unit_Delay_DSTATE_oj = L4_MABX_P.Unit_Delay_InitialCondition_k;
31260
31261 /* SystemInitialize for Outport: '<S183>/Brake_hold_brake_press_target_kpa' */
31262 L4_MABX_B.If_Then_Else_gj.Switch = L4_MABX_P.Brake_hold_brake_press_target_k;
31263
31264 /* SystemInitialize for Outport: '<S183>/F_Brake_hold_conditions_met' */
31265 L4_MABX_B.F_Brake_hold_conditions_met =
31266 L4_MABX_P.F_Brake_hold_conditions_met_Y0;
31267
31268 /* End of SystemInitialize for SubSystem: '<S105>/Determine_brake_hold_pressure_target' */
31269
31270 /* SystemInitialize for Enabled SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */
31271 /* InitializeConditions for UnitDelay: '<S111>/Unit_Delay' */
31272 L4_MABX_DW.Unit_Delay_DSTATE_d = L4_MABX_P.Unit_Delay_InitialCondition;
31273
31274 /* InitializeConditions for UnitDelay: '<S115>/Unit_Delay' */
31275 L4_MABX_DW.Unit_Delay_DSTATE_omj = L4_MABX_P.Unit_Delay_InitialCondition_lt;
31276
31277 /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay1' */
31278 L4_MABX_DW.Unit_Delay1_DSTATE_b = L4_MABX_P.Unit_Delay1_InitialCondition;
31279
31280 /* InitializeConditions for UnitDelay: '<S136>/Unit_Delay' */
31281 L4_MABX_DW.Unit_Delay_DSTATE_h4 = L4_MABX_P.Unit_Delay_InitialCondition_og;
31282
31283 /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay2' */
31284 L4_MABX_DW.FixPtUnitDelay2_DSTATE_gm =
31285 L4_MABX_P.FixPtUnitDelay2_InitialConditio;
31286
31287 /* InitializeConditions for UnitDelay: '<S140>/FixPt Unit Delay1' */
31288 L4_MABX_DW.FixPtUnitDelay1_DSTATE_g1 =
31289 L4_MABX_P.FixPtUnitDelay1_InitialConditio;
31290
31291 /* InitializeConditions for UnitDelay: '<S135>/Unit_Delay2' */
31292 L4_MABX_DW.Unit_Delay2_DSTATE_dy = L4_MABX_P.Unit_Delay2_InitialCondition;
31293
31294 /* InitializeConditions for UnitDelay: '<S110>/Unit_Delay' */
31295 L4_MABX_DW.Unit_Delay_DSTATE_i = L4_MABX_P.Unit_Delay_InitialCondition_p;
31296
31297 /* SystemInitialize for Enabled SubSystem: '<S112>/Calculate_D_term' */
31298 L4_MA_Calculate_D_term_Init(&L4_MABX_B.Calculate_D_term,
31299 &L4_MABX_DW.Calculate_D_term, &L4_MABX_P.Calculate_D_term);
31300
31301 /* End of SystemInitialize for SubSystem: '<S112>/Calculate_D_term' */
31302
31303 /* SystemInitialize for Enabled SubSystem: '<S112>/Calculate_I_term' */
31304 L4_MA_Calculate_I_term_Init(&L4_MABX_B.Calculate_I_term,
31305 &L4_MABX_DW.Calculate_I_term, &L4_MABX_P.Calculate_I_term);
31306
31307 /* End of SystemInitialize for SubSystem: '<S112>/Calculate_I_term' */
31308
31309 /* SystemInitialize for Outport: '<S102>/PID_output' */
31310 L4_MABX_B.If_Then_Else_nj.Switch = L4_MABX_P.PID_output_Y0;
31311
31312 /* End of SystemInitialize for SubSystem: '<S77>/Bendix_2C2_brake_application_pressure_feedback_controller' */
31313
31314 /* SystemInitialize for Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */
31315 L4_MABX_B.TimeVectorRaw[0] = 0.0;
31316 L4_MABX_B.TimeVectorRaw[1] = 0.001;
31317 L4_MABX_B.TimeVectorRaw[2] = 0.002;
31318 L4_MABX_B.TimeVectorRaw[3] = 0.003;
31319 L4_MABX_B.TimeVectorRaw[4] = 0.004;
31320 L4_MABX_B.TimeVectorRaw[5] = 0.005;
31321 L4_MABX_B.PositionVectorRaw[0] = 0.0;
31322 L4_MABX_B.PositionVectorRaw[1] = 0.001;
31323 L4_MABX_B.PositionVectorRaw[2] = 0.002;
31324 L4_MABX_B.PositionVectorRaw[3] = 0.003;
31325 L4_MABX_B.PositionVectorRaw[4] = 0.004;
31326 L4_MABX_B.PositionVectorRaw[5] = 0.005;
31327 for (i = 0; i < 6; i++) {
31328 L4_MABX_B.VelocityVectorRaw[i] = 0.0;
31329 L4_MABX_B.AccelerationVectorRaw[i] = 0.0;
31330 L4_MABX_B.JerkVectorRaw[i] = 0.0;
31331 }
31332
31333 /* End of SystemInitialize for Chart: '<S344>/VehicleSpeedSetpointDynamicCalculation' */
31334
31335 /* SystemInitialize for Chart: '<S344>/TwentyPointVectorCalculation' */
31336 L4_MABX_B.TimeVector[0] = 0.0;
31337 L4_MABX_B.TimeVector[1] = 0.001;
31338 L4_MABX_B.TimeVector[2] = 0.002;
31339 L4_MABX_B.TimeVector[3] = 0.003;
31340 L4_MABX_B.TimeVector[4] = 0.004;
31341 L4_MABX_B.TimeVector[5] = 0.005;
31342 L4_MABX_B.TimeVector[6] = 0.006;
31343 L4_MABX_B.TimeVector[7] = 0.007;
31344 L4_MABX_B.TimeVector[8] = 0.008;
31345 L4_MABX_B.TimeVector[9] = 0.0090000000000000011;
31346 L4_MABX_B.TimeVector[10] = 0.01;
31347 L4_MABX_B.TimeVector[11] = 0.011;
31348 L4_MABX_B.TimeVector[12] = 0.012;
31349 L4_MABX_B.TimeVector[13] = 0.013000000000000001;
31350 L4_MABX_B.TimeVector[14] = 0.014;
31351 L4_MABX_B.TimeVector[15] = 0.015;
31352 L4_MABX_B.TimeVector[16] = 0.016;
31353 L4_MABX_B.TimeVector[17] = 0.017;
31354 L4_MABX_B.TimeVector[18] = 0.018000000000000002;
31355 L4_MABX_B.TimeVector[19] = 0.019;
31356 L4_MABX_B.TimeVector[20] = 0.02;
31357 L4_MABX_B.TimeVector[21] = 0.021;
31358 L4_MABX_B.TimeVector[22] = 0.022;
31359 L4_MABX_B.TimeVector[23] = 0.023;
31360 L4_MABX_B.TimeVector[24] = 0.024;
31361 L4_MABX_B.TimeVector[25] = 0.025;
31362 L4_MABX_B.TimeVector[26] = 0.026000000000000002;
31363 L4_MABX_B.TimeVector[27] = 0.027;
31364 L4_MABX_B.TimeVector[28] = 0.028;
31365 L4_MABX_B.TimeVector[29] = 0.029;
31366 L4_MABX_B.TimeVector[30] = 0.03;
31367 L4_MABX_B.TimeVector[31] = 0.031;
31368 L4_MABX_B.TimeVector[32] = 0.032;
31369 L4_MABX_B.PositionVector[0] = 0.0;
31370 L4_MABX_B.PositionVector[1] = 0.001;
31371 L4_MABX_B.PositionVector[2] = 0.002;
31372 L4_MABX_B.PositionVector[3] = 0.003;
31373 L4_MABX_B.PositionVector[4] = 0.004;
31374 L4_MABX_B.PositionVector[5] = 0.005;
31375 L4_MABX_B.PositionVector[6] = 0.006;
31376 L4_MABX_B.PositionVector[7] = 0.007;
31377 L4_MABX_B.PositionVector[8] = 0.008;
31378 L4_MABX_B.PositionVector[9] = 0.0090000000000000011;
31379 L4_MABX_B.PositionVector[10] = 0.01;
31380 L4_MABX_B.PositionVector[11] = 0.011;
31381 L4_MABX_B.PositionVector[12] = 0.012;
31382 L4_MABX_B.PositionVector[13] = 0.013000000000000001;
31383 L4_MABX_B.PositionVector[14] = 0.014;
31384 L4_MABX_B.PositionVector[15] = 0.015;
31385 L4_MABX_B.PositionVector[16] = 0.016;
31386 L4_MABX_B.PositionVector[17] = 0.017;
31387 L4_MABX_B.PositionVector[18] = 0.018000000000000002;
31388 L4_MABX_B.PositionVector[19] = 0.019;
31389 L4_MABX_B.PositionVector[20] = 0.02;
31390 L4_MABX_B.PositionVector[21] = 0.021;
31391 L4_MABX_B.PositionVector[22] = 0.022;
31392 L4_MABX_B.PositionVector[23] = 0.023;
31393 L4_MABX_B.PositionVector[24] = 0.024;
31394 L4_MABX_B.PositionVector[25] = 0.025;
31395 L4_MABX_B.PositionVector[26] = 0.026000000000000002;
31396 L4_MABX_B.PositionVector[27] = 0.027;
31397 L4_MABX_B.PositionVector[28] = 0.028;
31398 L4_MABX_B.PositionVector[29] = 0.029;
31399 L4_MABX_B.PositionVector[30] = 0.03;
31400 L4_MABX_B.PositionVector[31] = 0.031;
31401 L4_MABX_B.PositionVector[32] = 0.032;
31402 memset(&L4_MABX_B.VelocityVector[0], 0, 33U * sizeof(real_T));
31403 memset(&L4_MABX_B.AccelerationVector[0], 0, 33U * sizeof(real_T));
31404 memset(&L4_MABX_B.JerkVector[0], 0, 33U * sizeof(real_T));
31405
31406 /* SystemInitialize for Enabled SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */
31407 /* InitializeConditions for UnitDelay: '<S146>/Unit_Delay' */
31408 L4_MABX_DW.Unit_Delay_DSTATE_eu = L4_MABX_P.Unit_Delay_InitialCondition_f;
31409
31410 /* InitializeConditions for UnitDelay: '<S153>/Unit_Delay' */
31411 L4_MABX_DW.Unit_Delay_DSTATE_n = L4_MABX_P.Unit_Delay_InitialCondition_jb;
31412
31413 /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay1' */
31414 L4_MABX_DW.Unit_Delay1_DSTATE_f = L4_MABX_P.Unit_Delay1_InitialCondition_p;
31415
31416 /* InitializeConditions for UnitDelay: '<S174>/Unit_Delay' */
31417 L4_MABX_DW.Unit_Delay_DSTATE_g4 = L4_MABX_P.Unit_Delay_InitialCondition_lq;
31418
31419 /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay2' */
31420 L4_MABX_DW.FixPtUnitDelay2_DSTATE_o4 =
31421 L4_MABX_P.FixPtUnitDelay2_InitialCondit_p;
31422
31423 /* InitializeConditions for UnitDelay: '<S178>/FixPt Unit Delay1' */
31424 L4_MABX_DW.FixPtUnitDelay1_DSTATE_g2 =
31425 L4_MABX_P.FixPtUnitDelay1_InitialCondit_b;
31426
31427 /* InitializeConditions for UnitDelay: '<S173>/Unit_Delay2' */
31428 L4_MABX_DW.Unit_Delay2_DSTATE_c = L4_MABX_P.Unit_Delay2_InitialCondition_b;
31429
31430 /* InitializeConditions for UnitDelay: '<S145>/Unit_Delay' */
31431 L4_MABX_DW.Unit_Delay_DSTATE_h = L4_MABX_P.Unit_Delay_InitialCondition_h;
31432
31433 /* SystemInitialize for Enabled SubSystem: '<S150>/Calculate_D_term' */
31434 L4_MA_Calculate_D_term_Init(&L4_MABX_B.Calculate_D_term_p,
31435 &L4_MABX_DW.Calculate_D_term_p, &L4_MABX_P.Calculate_D_term_p);
31436
31437 /* End of SystemInitialize for SubSystem: '<S150>/Calculate_D_term' */
31438
31439 /* SystemInitialize for Enabled SubSystem: '<S150>/Calculate_I_term' */
31440 L4_MA_Calculate_I_term_Init(&L4_MABX_B.Calculate_I_term_e,
31441 &L4_MABX_DW.Calculate_I_term_e, &L4_MABX_P.Calculate_I_term_e);
31442
31443 /* End of SystemInitialize for SubSystem: '<S150>/Calculate_I_term' */
31444
31445 /* SystemInitialize for Outport: '<S103>/PID_output' */
31446 L4_MABX_B.If_Then_Else_fo.Switch = L4_MABX_P.PID_output_Y0_p;
31447
31448 /* End of SystemInitialize for SubSystem: '<S77>/Bendix_2C2_vehicle_speed_feedback_pressure_controller' */
31449
31450 /* SystemInitialize for Chart: '<S79>/Chart' */
31451 L4_MABX_DW.is_active_c19_SUB_L4_Task_10ms_ = 0U;
31452 L4_MABX_DW.is_c19_SUB_L4_Task_10ms_SUB_STA = L4_MABX_IN_NO_ACTIVE_CHILD;
31453 L4_MABX_B.CtrlState = ENUM_AUTO_CTRL_STATE_T_NOT_AVAILABLE;
31454 L4_MABX_B.VehCtrlState = ENUM_AUTO_CTRL_VEHICLE_STATE_T_NOT_AVAILABLE;
31455
31456 /* SystemInitialize for Enabled SubSystem: '<S79>/Engine_speed_target' */
31457 /* SystemInitialize for Outport: '<S210>/Out1' */
31458 L4_MABX_B.MinMax1_n = L4_MABX_P.Out1_Y0;
31459
31460 /* End of SystemInitialize for SubSystem: '<S79>/Engine_speed_target' */
31461
31462 /* SystemInitialize for Chart: '<S211>/Relay_control_state_machine' */
31463 L4_MABX_DW.is_POWER_DOWN_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD;
31464 L4_MABX_DW.is_POWER_UP_ROUTINE = L4_MABX_IN_NO_ACTIVE_CHILD;
31465 L4_MABX_DW.temporalCounter_i1 = 0U;
31466 L4_MABX_DW.is_active_c6_SUB_L4_Task_10ms_S = 0U;
31467 L4_MABX_DW.is_c6_SUB_L4_Task_10ms_SUB_STAT = L4_MABX_IN_NO_ACTIVE_CHILD;
31468
31469 /* SystemInitialize for Chart: '<S283>/Chart' */
31470 L4_MABX_DW.is_active_c12_SUB_L4_Task_10ms_ = 0U;
31471 L4_MABX_DW.is_c12_SUB_L4_Task_10ms_SUB_STE = L4_MABX_IN_NO_ACTIVE_CHILD;
31472
31473 /* SystemInitialize for Enabled SubSystem: '<S283>/Slew_at_event' */
31474 /* InitializeConditions for UnitDelay: '<S336>/Unit_Delay' */
31475 L4_MABX_DW.Unit_Delay_DSTATE_bd = L4_MABX_P.Unit_Delay_InitialCondition_ls;
31476
31477 /* InitializeConditions for UnitDelay: '<S337>/Unit_Delay' */
31478 L4_MABX_DW.Unit_Delay_DSTATE_jt = L4_MABX_P.Unit_Delay_InitialCondition_i0;
31479
31480 /* InitializeConditions for UnitDelay: '<S340>/FixPt Unit Delay2' */
31481 L4_MABX_DW.FixPtUnitDelay2_DSTATE_j =
31482 L4_MABX_P.FixPtUnitDelay2_InitialCondit_c;
31483
31484 /* InitializeConditions for UnitDelay: '<S340>/FixPt Unit Delay1' */
31485 L4_MABX_DW.FixPtUnitDelay1_DSTATE_ov =
31486 L4_MABX_P.FixPtUnitDelay1_InitialCondit_f;
31487
31488 /* InitializeConditions for UnitDelay: '<S335>/Unit_Delay' */
31489 L4_MABX_DW.Unit_Delay_DSTATE_ll = L4_MABX_P.Unit_Delay_InitialCondition_ld;
31490
31491 /* SystemInitialize for Outport: '<S334>/F_Out_slewing' */
31492 L4_MABX_B.LogicalOperator_dm = L4_MABX_P.F_Out_slewing_Y0;
31493
31494 /* SystemInitialize for Outport: '<S334>/Out' */
31495 L4_MABX_B.If_Then_Else_n3.Switch = L4_MABX_P.Out_Y0;
31496
31497 /* End of SystemInitialize for SubSystem: '<S283>/Slew_at_event' */
31498 /* End of SystemInitialize for SubSystem: '<S65>/Task_10ms' */
31499
31500 /* SystemInitialize for Enabled SubSystem: '<S625>/PosRapidUpdate_011' */
31501 /* SystemInitialize for Outport: '<S626>/Latitude_' */
31502 L4_MABX_B.SFunction1_o1_b = L4_MABX_P.Latitude_Y0;
31503
31504 /* SystemInitialize for Outport: '<S626>/Longitude_' */
31505 L4_MABX_B.SFunction1_o2_nv = L4_MABX_P.Longitude_Y0;
31506
31507 /* SystemInitialize for Outport: '<S626>/RX status' */
31508 L4_MABX_B.SFunction1_o3_pv = L4_MABX_P.RXstatus_Y0_nd;
31509
31510 /* SystemInitialize for Outport: '<S626>/RX time' */
31511 L4_MABX_B.SFunction1_o4_fz = L4_MABX_P.RXtime_Y0_o2;
31512
31513 /* SystemInitialize for Outport: '<S626>/RX delta time' */
31514 L4_MABX_B.SFunction1_o5_i = L4_MABX_P.RXdeltatime_Y0_l;
31515
31516 /* End of SystemInitialize for SubSystem: '<S625>/PosRapidUpdate_011' */
31517
31518 /* SystemInitialize for Enabled SubSystem: '<S625>/PosRapidUpdate_1' */
31519 /* SystemInitialize for Outport: '<S627>/Latitude_' */
31520 L4_MABX_B.SFunction1_o1_po = L4_MABX_P.Latitude_Y0_j;
31521
31522 /* SystemInitialize for Outport: '<S627>/Longitude_' */
31523 L4_MABX_B.SFunction1_o2_bc = L4_MABX_P.Longitude_Y0_l;
31524
31525 /* SystemInitialize for Outport: '<S627>/RX status' */
31526 L4_MABX_B.SFunction1_o3_g4 = L4_MABX_P.RXstatus_Y0_nh;
31527
31528 /* SystemInitialize for Outport: '<S627>/RX time' */
31529 L4_MABX_B.SFunction1_o4_b = L4_MABX_P.RXtime_Y0_kz;
31530
31531 /* SystemInitialize for Outport: '<S627>/RX delta time' */
31532 L4_MABX_B.SFunction1_o5_g = L4_MABX_P.RXdeltatime_Y0_g;
31533
31534 /* End of SystemInitialize for SubSystem: '<S625>/PosRapidUpdate_1' */
31535
31536 /* SystemInitialize for Enabled SubSystem: '<S505>/CCVS1_00' */
31537 /* SystemInitialize for Outport: '<S506>/TwoSpeedAxleSwitch' */
31538 L4_MABX_B.SFunction1_o1_fl = L4_MABX_P.TwoSpeedAxleSwitch_Y0;
31539
31540 /* SystemInitialize for Outport: '<S506>/ParkingBrakeSwitch' */
31541 L4_MABX_B.SFunction1_o2_bu = L4_MABX_P.ParkingBrakeSwitch_Y0;
31542
31543 /* SystemInitialize for Outport: '<S506>/CruiseCtrlPauseSwitch' */
31544 L4_MABX_B.SFunction1_o3_ko = L4_MABX_P.CruiseCtrlPauseSwitch_Y0;
31545
31546 /* SystemInitialize for Outport: '<S506>/ParkBrakeReleaseInhibitRq' */
31547 L4_MABX_B.SFunction1_o4_kv = L4_MABX_P.ParkBrakeReleaseInhibitRq_Y0;
31548
31549 /* SystemInitialize for Outport: '<S506>/WheelBasedVehicleSpeed' */
31550 WheelBasedVehicleSpeed = L4_MABX_P.WheelBasedVehicleSpeed_Y0;
31551
31552 /* SystemInitialize for Outport: '<S506>/CruiseCtrlActive' */
31553 L4_MABX_B.SFunction1_o6_mm = L4_MABX_P.CruiseCtrlActive_Y0;
31554
31555 /* SystemInitialize for Outport: '<S506>/CruiseCtrlEnableSwitch' */
31556 L4_MABX_B.SFunction1_o7_m1 = L4_MABX_P.CruiseCtrlEnableSwitch_Y0;
31557
31558 /* SystemInitialize for Outport: '<S506>/BrakeSwitch' */
31559 BrakeSwitch = L4_MABX_P.BrakeSwitch_Y0;
31560
31561 /* SystemInitialize for Outport: '<S506>/ClutchSwitch' */
31562 L4_MABX_B.SFunction1_o9_py = L4_MABX_P.ClutchSwitch_Y0;
31563
31564 /* SystemInitialize for Outport: '<S506>/CruiseCtrlSetSwitch' */
31565 L4_MABX_B.SFunction1_o10_a = L4_MABX_P.CruiseCtrlSetSwitch_Y0;
31566
31567 /* SystemInitialize for Outport: '<S506>/CruiseCtrlCoastSwitch' */
31568 L4_MABX_B.SFunction1_o11_mi = L4_MABX_P.CruiseCtrlCoastSwitch_Y0;
31569
31570 /* SystemInitialize for Outport: '<S506>/CruiseCtrlResumeSwitch' */
31571 L4_MABX_B.SFunction1_o12_k = L4_MABX_P.CruiseCtrlResumeSwitch_Y0;
31572
31573 /* SystemInitialize for Outport: '<S506>/CruiseCtrlAccelerateSwitch' */
31574 L4_MABX_B.SFunction1_o13_gj = L4_MABX_P.CruiseCtrlAccelerateSwitch_Y0;
31575
31576 /* SystemInitialize for Outport: '<S506>/CruiseCtrlSetSpeed' */
31577 L4_MABX_B.SFunction1_o14_e = L4_MABX_P.CruiseCtrlSetSpeed_Y0;
31578
31579 /* SystemInitialize for Outport: '<S506>/PTOGovernorState' */
31580 L4_MABX_B.SFunction1_o15_pj = L4_MABX_P.PTOGovernorState_Y0;
31581
31582 /* SystemInitialize for Outport: '<S506>/CruiseCtrlStates' */
31583 L4_MABX_B.SFunction1_o16_g = L4_MABX_P.CruiseCtrlStates_Y0;
31584
31585 /* SystemInitialize for Outport: '<S506>/EngIdleIncrementSwitch' */
31586 L4_MABX_B.SFunction1_o17_k = L4_MABX_P.EngIdleIncrementSwitch_Y0;
31587
31588 /* SystemInitialize for Outport: '<S506>/EngIdleDecrementSwitch' */
31589 L4_MABX_B.SFunction1_o18_e = L4_MABX_P.EngIdleDecrementSwitch_Y0;
31590
31591 /* SystemInitialize for Outport: '<S506>/EngTestModeSwitch' */
31592 L4_MABX_B.SFunction1_o19_a = L4_MABX_P.EngTestModeSwitch_Y0;
31593
31594 /* SystemInitialize for Outport: '<S506>/EngShutdownOverrideSwitch' */
31595 L4_MABX_B.SFunction1_o20_f = L4_MABX_P.EngShutdownOverrideSwitch_Y0;
31596
31597 /* SystemInitialize for Outport: '<S506>/RX status' */
31598 L4_MABX_B.SFunction1_o21_c = L4_MABX_P.RXstatus_Y0_a;
31599
31600 /* SystemInitialize for Outport: '<S506>/RX time' */
31601 L4_MABX_B.SFunction1_o22_og = L4_MABX_P.RXtime_Y0_op;
31602
31603 /* SystemInitialize for Outport: '<S506>/RX delta time' */
31604 L4_MABX_B.SFunction1_o23_a = L4_MABX_P.RXdeltatime_Y0_i;
31605
31606 /* End of SystemInitialize for SubSystem: '<S505>/CCVS1_00' */
31607
31608 /* SystemInitialize for Enabled SubSystem: '<S509>/COGSOGRapidUpdate_00' */
31609 /* SystemInitialize for Outport: '<S510>/SID' */
31610 L4_MABX_B.SFunction1_o1_c5 = L4_MABX_P.SID_Y0;
31611
31612 /* SystemInitialize for Outport: '<S510>/COGReference' */
31613 L4_MABX_B.SFunction1_o2_dq = L4_MABX_P.COGReference_Y0;
31614
31615 /* SystemInitialize for Outport: '<S510>/CourseOverGround' */
31616 L4_MABX_B.SFunction1_o3_hj = L4_MABX_P.CourseOverGround_Y0;
31617
31618 /* SystemInitialize for Outport: '<S510>/SpeedOverGround' */
31619 L4_MABX_B.SFunction1_o4_gu = L4_MABX_P.SpeedOverGround_Y0;
31620
31621 /* SystemInitialize for Outport: '<S510>/RX status' */
31622 L4_MABX_B.SFunction1_o5_ly = L4_MABX_P.RXstatus_Y0_ddm;
31623
31624 /* SystemInitialize for Outport: '<S510>/RX time' */
31625 L4_MABX_B.SFunction1_o6_hp = L4_MABX_P.RXtime_Y0_j;
31626
31627 /* SystemInitialize for Outport: '<S510>/RX delta time' */
31628 L4_MABX_B.SFunction1_o7_ol = L4_MABX_P.RXdeltatime_Y0_hs;
31629
31630 /* End of SystemInitialize for SubSystem: '<S509>/COGSOGRapidUpdate_00' */
31631
31632 /* SystemInitialize for Enabled SubSystem: '<S509>/COGSOGRapidUpdate_1' */
31633 /* SystemInitialize for Outport: '<S511>/SID' */
31634 L4_MABX_B.SFunction1_o1_ieu = L4_MABX_P.SID_Y0_k;
31635
31636 /* SystemInitialize for Outport: '<S511>/COGReference' */
31637 L4_MABX_B.SFunction1_o2_bf = L4_MABX_P.COGReference_Y0_c;
31638
31639 /* SystemInitialize for Outport: '<S511>/CourseOverGround' */
31640 L4_MABX_B.SFunction1_o3_er = L4_MABX_P.CourseOverGround_Y0_c;
31641
31642 /* SystemInitialize for Outport: '<S511>/SpeedOverGround' */
31643 L4_MABX_B.SFunction1_o4_ik = L4_MABX_P.SpeedOverGround_Y0_a;
31644
31645 /* SystemInitialize for Outport: '<S511>/RX status' */
31646 L4_MABX_B.SFunction1_o5_lq = L4_MABX_P.RXstatus_Y0_m;
31647
31648 /* SystemInitialize for Outport: '<S511>/RX time' */
31649 L4_MABX_B.SFunction1_o6_fk = L4_MABX_P.RXtime_Y0_f;
31650
31651 /* SystemInitialize for Outport: '<S511>/RX delta time' */
31652 L4_MABX_B.SFunction1_o7_i = L4_MABX_P.RXdeltatime_Y0_d0;
31653
31654 /* End of SystemInitialize for SubSystem: '<S509>/COGSOGRapidUpdate_1' */
31655
31656 /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_100ms' */
31657 /* SystemInitialize for Enabled SubSystem: '<S886>/Rolling_15_counter' */
31658 /* InitializeConditions for UnitDelay: '<S928>/Unit_Delay' */
31659 L4_MABX_DW.Unit_Delay_DSTATE = L4_MABX_P.Unit_Delay_InitialCondition_n;
31660
31661 /* SystemInitialize for Outport: '<S928>/Rolling_15_counter' */
31662 L4_MABX_B.Unit_Delay = L4_MABX_P.Rolling_15_counter_Y0;
31663
31664 /* End of SystemInitialize for SubSystem: '<S886>/Rolling_15_counter' */
31665
31666 /* SystemInitialize for Enabled SubSystem: '<S908>/PropB_XPR_FC' */
31667 /* SystemInitialize for Outport: '<S910>/TX status' */
31668 L4_MABX_B.SFunction1_o1_o = L4_MABX_P.TXstatus_Y0_p;
31669
31670 /* SystemInitialize for Outport: '<S910>/TX time' */
31671 L4_MABX_B.SFunction1_o2_nm = L4_MABX_P.TXtime_Y0_f;
31672
31673 /* SystemInitialize for Outport: '<S910>/TX delta time' */
31674 L4_MABX_B.SFunction1_o3_lz = L4_MABX_P.TXdeltatime_Y0_m;
31675
31676 /* SystemInitialize for Outport: '<S910>/TX delay time' */
31677 L4_MABX_B.SFunction1_o4_d = L4_MABX_P.TXdelaytime_Y0_e;
31678
31679 /* End of SystemInitialize for SubSystem: '<S908>/PropB_XPR_FC' */
31680
31681 /* SystemInitialize for Enabled SubSystem: '<S909>/PropB_XPR_FC' */
31682 /* SystemInitialize for Outport: '<S911>/TX status' */
31683 L4_MABX_B.SFunction1_o1_ag = L4_MABX_P.TXstatus_Y0_j;
31684
31685 /* SystemInitialize for Outport: '<S911>/TX time' */
31686 L4_MABX_B.SFunction1_o2_gg = L4_MABX_P.TXtime_Y0_g;
31687
31688 /* SystemInitialize for Outport: '<S911>/TX delta time' */
31689 L4_MABX_B.SFunction1_o3_o = L4_MABX_P.TXdeltatime_Y0_e;
31690
31691 /* SystemInitialize for Outport: '<S911>/TX delay time' */
31692 L4_MABX_B.SFunction1_o4_pe = L4_MABX_P.TXdelaytime_Y0_eh;
31693
31694 /* End of SystemInitialize for SubSystem: '<S909>/PropB_XPR_FC' */
31695
31696 /* SystemInitialize for Enabled SubSystem: '<S938>/Std_PosRapidUpdate_01' */
31697 /* SystemInitialize for Outport: '<S939>/TX status' */
31698 L4_MABX_B.SFunction1_o1_ko = L4_MABX_P.TXstatus_Y0_k;
31699
31700 /* SystemInitialize for Outport: '<S939>/TX time' */
31701 L4_MABX_B.SFunction1_o2_jw = L4_MABX_P.TXtime_Y0_h;
31702
31703 /* SystemInitialize for Outport: '<S939>/TX delta time' */
31704 L4_MABX_B.SFunction1_o3_mo = L4_MABX_P.TXdeltatime_Y0_ls;
31705
31706 /* SystemInitialize for Outport: '<S939>/TX delay time' */
31707 L4_MABX_B.SFunction1_o4_a = L4_MABX_P.TXdelaytime_Y0_f;
31708
31709 /* End of SystemInitialize for SubSystem: '<S938>/Std_PosRapidUpdate_01' */
31710
31711 /* SystemInitialize for Enabled SubSystem: '<S888>/CCVS1_00' */
31712 /* SystemInitialize for Outport: '<S890>/TX status' */
31713 L4_MABX_B.SFunction1_o1_pr = L4_MABX_P.TXstatus_Y0_c;
31714
31715 /* SystemInitialize for Outport: '<S890>/TX time' */
31716 L4_MABX_B.SFunction1_o2_co = L4_MABX_P.TXtime_Y0_j;
31717
31718 /* SystemInitialize for Outport: '<S890>/TX delta time' */
31719 L4_MABX_B.SFunction1_o3_ls = L4_MABX_P.TXdeltatime_Y0_o;
31720
31721 /* SystemInitialize for Outport: '<S890>/TX delay time' */
31722 L4_MABX_B.SFunction1_o4_f = L4_MABX_P.TXdelaytime_Y0_j;
31723
31724 /* End of SystemInitialize for SubSystem: '<S888>/CCVS1_00' */
31725
31726 /* SystemInitialize for Enabled SubSystem: '<S889>/CCVS1_00' */
31727 /* SystemInitialize for Outport: '<S891>/TX status' */
31728 L4_MABX_B.SFunction1_o1_aj = L4_MABX_P.TXstatus_Y0_g;
31729
31730 /* SystemInitialize for Outport: '<S891>/TX time' */
31731 L4_MABX_B.SFunction1_o2_nb = L4_MABX_P.TXtime_Y0_n;
31732
31733 /* SystemInitialize for Outport: '<S891>/TX delta time' */
31734 L4_MABX_B.SFunction1_o3_c = L4_MABX_P.TXdeltatime_Y0_l;
31735
31736 /* SystemInitialize for Outport: '<S891>/TX delay time' */
31737 L4_MABX_B.SFunction1_o4_c4 = L4_MABX_P.TXdelaytime_Y0_gk;
31738
31739 /* End of SystemInitialize for SubSystem: '<S889>/CCVS1_00' */
31740
31741 /* SystemInitialize for Enabled SubSystem: '<S892>/PropB_REAX_5_E4' */
31742 /* SystemInitialize for Outport: '<S894>/TX status' */
31743 L4_MABX_B.SFunction1_o1_ev = L4_MABX_P.TXstatus_Y0_n;
31744
31745 /* SystemInitialize for Outport: '<S894>/TX time' */
31746 L4_MABX_B.SFunction1_o2_h = L4_MABX_P.TXtime_Y0_d;
31747
31748 /* SystemInitialize for Outport: '<S894>/TX delta time' */
31749 L4_MABX_B.SFunction1_o3_hm = L4_MABX_P.TXdeltatime_Y0_a;
31750
31751 /* SystemInitialize for Outport: '<S894>/TX delay time' */
31752 L4_MABX_B.SFunction1_o4_l = L4_MABX_P.TXdelaytime_Y0_p;
31753
31754 /* End of SystemInitialize for SubSystem: '<S892>/PropB_REAX_5_E4' */
31755
31756 /* SystemInitialize for Enabled SubSystem: '<S893>/PropB_REAX_5_E4' */
31757 /* SystemInitialize for Outport: '<S895>/TX status' */
31758 L4_MABX_B.SFunction1_o1_cb = L4_MABX_P.TXstatus_Y0_e;
31759
31760 /* SystemInitialize for Outport: '<S895>/TX time' */
31761 L4_MABX_B.SFunction1_o2_nh = L4_MABX_P.TXtime_Y0_jj;
31762
31763 /* SystemInitialize for Outport: '<S895>/TX delta time' */
31764 L4_MABX_B.SFunction1_o3_fe = L4_MABX_P.TXdeltatime_Y0_a2;
31765
31766 /* SystemInitialize for Outport: '<S895>/TX delay time' */
31767 L4_MABX_B.SFunction1_o4_eb = L4_MABX_P.TXdelaytime_Y0_i;
31768
31769 /* End of SystemInitialize for SubSystem: '<S893>/PropB_REAX_5_E4' */
31770
31771 /* SystemInitialize for Enabled SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' */
31772 /* SystemInitialize for Outport: '<S913>/TX status' */
31773 L4_MABX_B.SFunction1_o1_p = L4_MABX_P.TXstatus_Y0_et;
31774
31775 /* SystemInitialize for Outport: '<S913>/TX time' */
31776 L4_MABX_B.SFunction1_o2_brz = L4_MABX_P.TXtime_Y0_o;
31777
31778 /* SystemInitialize for Outport: '<S913>/TX delta time' */
31779 L4_MABX_B.SFunction1_o3_hv = L4_MABX_P.TXdeltatime_Y0_ag;
31780
31781 /* SystemInitialize for Outport: '<S913>/TX delay time' */
31782 L4_MABX_B.SFunction1_o4_m0 = L4_MABX_P.TXdelaytime_Y0_gl;
31783
31784 /* End of SystemInitialize for SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' */
31785
31786 /* SystemInitialize for Enabled SubSystem: '<S914>/EBC1_TX' */
31787 /* SystemInitialize for Outport: '<S915>/TX status' */
31788 L4_MABX_B.SFunction1_o1_jg = L4_MABX_P.TXstatus_Y0_l;
31789
31790 /* SystemInitialize for Outport: '<S915>/TX time' */
31791 L4_MABX_B.SFunction1_o2_g = L4_MABX_P.TXtime_Y0_pc;
31792
31793 /* SystemInitialize for Outport: '<S915>/TX delta time' */
31794 L4_MABX_B.SFunction1_o3_nw = L4_MABX_P.TXdeltatime_Y0_f;
31795
31796 /* SystemInitialize for Outport: '<S915>/TX delay time' */
31797 L4_MABX_B.SFunction1_o4_jg = L4_MABX_P.TXdelaytime_Y0_a;
31798
31799 /* End of SystemInitialize for SubSystem: '<S914>/EBC1_TX' */
31800 /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_100ms' */
31801
31802 /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_10ms' */
31803 /* InitializeConditions for UnitDelay: '<S1006>/Unit_Delay' */
31804 L4_MABX_DW.Unit_Delay_DSTATE_im = L4_MABX_P.Unit_Delay_InitialCondition_ay;
31805
31806 /* InitializeConditions for UnitDelay: '<S1007>/Unit Delay' */
31807 L4_MABX_DW.UnitDelay_DSTATE_mk = L4_MABX_P.UnitDelay_InitialCondition_ph;
31808
31809 /* SystemInitialize for Enabled SubSystem: '<S951>/ACCS' */
31810 /* SystemInitialize for Outport: '<S952>/TX status' */
31811 L4_MABX_B.SFunction1_o1_kc = L4_MABX_P.TXstatus_Y0_f;
31812
31813 /* SystemInitialize for Outport: '<S952>/TX time' */
31814 L4_MABX_B.SFunction1_o2_o = L4_MABX_P.TXtime_Y0_gi;
31815
31816 /* SystemInitialize for Outport: '<S952>/TX delta time' */
31817 L4_MABX_B.SFunction1_o3_mw = L4_MABX_P.TXdeltatime_Y0_l5;
31818
31819 /* SystemInitialize for Outport: '<S952>/TX delay time' */
31820 L4_MABX_B.SFunction1_o4_gi = L4_MABX_P.TXdelaytime_Y0_jn;
31821
31822 /* End of SystemInitialize for SubSystem: '<S951>/ACCS' */
31823
31824 /* SystemInitialize for Enabled SubSystem: '<S959>/EEC1_00' */
31825 /* SystemInitialize for Outport: '<S961>/TX status' */
31826 L4_MABX_B.SFunction1_o1_ky = L4_MABX_P.TXstatus_Y0_b;
31827
31828 /* SystemInitialize for Outport: '<S961>/TX time' */
31829 L4_MABX_B.SFunction1_o2_l = L4_MABX_P.TXtime_Y0_jk;
31830
31831 /* SystemInitialize for Outport: '<S961>/TX delta time' */
31832 L4_MABX_B.SFunction1_o3_p = L4_MABX_P.TXdeltatime_Y0_h;
31833
31834 /* SystemInitialize for Outport: '<S961>/TX delay time' */
31835 L4_MABX_B.SFunction1_o4_ek = L4_MABX_P.TXdelaytime_Y0_ev;
31836
31837 /* End of SystemInitialize for SubSystem: '<S959>/EEC1_00' */
31838
31839 /* SystemInitialize for Enabled SubSystem: '<S960>/EEC1_00' */
31840 /* SystemInitialize for Outport: '<S962>/TX status' */
31841 L4_MABX_B.SFunction1_o1_l = L4_MABX_P.TXstatus_Y0_pg;
31842
31843 /* SystemInitialize for Outport: '<S962>/TX time' */
31844 L4_MABX_B.SFunction1_o2_jq = L4_MABX_P.TXtime_Y0_e;
31845
31846 /* SystemInitialize for Outport: '<S962>/TX delta time' */
31847 L4_MABX_B.SFunction1_o3_nn = L4_MABX_P.TXdeltatime_Y0_mg;
31848
31849 /* SystemInitialize for Outport: '<S962>/TX delay time' */
31850 L4_MABX_B.SFunction1_o4_g3 = L4_MABX_P.TXdelaytime_Y0_ae;
31851
31852 /* End of SystemInitialize for SubSystem: '<S960>/EEC1_00' */
31853
31854 /* SystemInitialize for Merge: '<S977>/Merge' */
31855 L4_MABX_B.Merge = L4_MABX_P.Merge_InitialOutput;
31856
31857 /* SystemInitialize for Enabled SubSystem: '<S963>/PropB_REAX_1_E4' */
31858 /* SystemInitialize for Outport: '<S965>/TX status' */
31859 L4_MABX_B.SFunction1_o1_a5 = L4_MABX_P.TXstatus_Y0_kn;
31860
31861 /* SystemInitialize for Outport: '<S965>/TX time' */
31862 L4_MABX_B.SFunction1_o2_nw = L4_MABX_P.TXtime_Y0_dc;
31863
31864 /* SystemInitialize for Outport: '<S965>/TX delta time' */
31865 L4_MABX_B.SFunction1_o3_g1 = L4_MABX_P.TXdeltatime_Y0_g;
31866
31867 /* SystemInitialize for Outport: '<S965>/TX delay time' */
31868 L4_MABX_B.SFunction1_o4_c = L4_MABX_P.TXdelaytime_Y0_o;
31869
31870 /* End of SystemInitialize for SubSystem: '<S963>/PropB_REAX_1_E4' */
31871
31872 /* SystemInitialize for Enabled SubSystem: '<S964>/PropB_REAX_1_E4' */
31873 /* SystemInitialize for Outport: '<S966>/TX status' */
31874 L4_MABX_B.SFunction1_o1_c = L4_MABX_P.TXstatus_Y0_fa;
31875
31876 /* SystemInitialize for Outport: '<S966>/TX time' */
31877 L4_MABX_B.SFunction1_o2_a = L4_MABX_P.TXtime_Y0_hf;
31878
31879 /* SystemInitialize for Outport: '<S966>/TX delta time' */
31880 L4_MABX_B.SFunction1_o3_n1 = L4_MABX_P.TXdeltatime_Y0_fv;
31881
31882 /* SystemInitialize for Outport: '<S966>/TX delay time' */
31883 L4_MABX_B.SFunction1_o4_my = L4_MABX_P.TXdelaytime_Y0_l;
31884
31885 /* End of SystemInitialize for SubSystem: '<S964>/PropB_REAX_1_E4' */
31886
31887 /* SystemInitialize for Enabled SubSystem: '<S973>/VDC2_0B' */
31888 /* SystemInitialize for Outport: '<S974>/TX status' */
31889 L4_MABX_B.SFunction1_o1_h4 = L4_MABX_P.TXstatus_Y0_i;
31890
31891 /* SystemInitialize for Outport: '<S974>/TX time' */
31892 L4_MABX_B.SFunction1_o2_b1 = L4_MABX_P.TXtime_Y0_eg;
31893
31894 /* SystemInitialize for Outport: '<S974>/TX delta time' */
31895 L4_MABX_B.SFunction1_o3_n = L4_MABX_P.TXdeltatime_Y0_n;
31896
31897 /* SystemInitialize for Outport: '<S974>/TX delay time' */
31898 L4_MABX_B.SFunction1_o4_jv = L4_MABX_P.TXdelaytime_Y0_d;
31899
31900 /* End of SystemInitialize for SubSystem: '<S973>/VDC2_0B' */
31901 /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_10ms' */
31902
31903 /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_20ms' */
31904 /* InitializeConditions for UnitDelay: '<S1011>/Unit_Delay' */
31905 L4_MABX_DW.Unit_Delay_DSTATE_bm = L4_MABX_P.Unit_Delay_InitialCondition_oc;
31906
31907 /* InitializeConditions for UnitDelay: '<S1034>/Unit_Delay' */
31908 L4_MABX_DW.Unit_Delay_DSTATE_jc = L4_MABX_P.Unit_Delay_InitialCondition_ah;
31909
31910 /* InitializeConditions for UnitDelay: '<S1035>/Unit Delay' */
31911 L4_MABX_DW.UnitDelay_DSTATE_c = L4_MABX_P.UnitDelay_InitialCondition_hz;
31912
31913 /* SystemInitialize for Enabled SubSystem: '<S1018>/PropB_XBR_B3' */
31914 /* SystemInitialize for Outport: '<S1019>/TX status' */
31915 L4_MABX_B.SFunction1_o1_hw = L4_MABX_P.TXstatus_Y0_ng;
31916
31917 /* SystemInitialize for Outport: '<S1019>/TX time' */
31918 L4_MABX_B.SFunction1_o2_c = L4_MABX_P.TXtime_Y0_dr;
31919
31920 /* SystemInitialize for Outport: '<S1019>/TX delta time' */
31921 L4_MABX_B.SFunction1_o3_l = L4_MABX_P.TXdeltatime_Y0_ns;
31922
31923 /* SystemInitialize for Outport: '<S1019>/TX delay time' */
31924 L4_MABX_B.SFunction1_o4_g = L4_MABX_P.TXdelaytime_Y0_c;
31925
31926 /* End of SystemInitialize for SubSystem: '<S1018>/PropB_XBR_B3' */
31927
31928 /* SystemInitialize for Enabled SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' */
31929 /* SystemInitialize for Outport: '<S1021>/TX status' */
31930 L4_MABX_B.SFunction1_o1_ao = L4_MABX_P.TXstatus_Y0_oc;
31931
31932 /* SystemInitialize for Outport: '<S1021>/TX time' */
31933 L4_MABX_B.SFunction1_o2_n = L4_MABX_P.TXtime_Y0_oj;
31934
31935 /* SystemInitialize for Outport: '<S1021>/TX delta time' */
31936 L4_MABX_B.SFunction1_o3_mp = L4_MABX_P.TXdeltatime_Y0_b;
31937
31938 /* SystemInitialize for Outport: '<S1021>/TX delay time' */
31939 L4_MABX_B.SFunction1_o4_k = L4_MABX_P.TXdelaytime_Y0_ao;
31940
31941 /* End of SystemInitialize for SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' */
31942
31943 /* SystemInitialize for Enabled SubSystem: '<S1028>/Std_OdometryData' */
31944 /* SystemInitialize for Outport: '<S1029>/TX status' */
31945 L4_MABX_B.SFunction1_o1_n = L4_MABX_P.TXstatus_Y0_p2;
31946
31947 /* SystemInitialize for Outport: '<S1029>/TX time' */
31948 L4_MABX_B.SFunction1_o2_j3 = L4_MABX_P.TXtime_Y0_du;
31949
31950 /* SystemInitialize for Outport: '<S1029>/TX delta time' */
31951 L4_MABX_B.SFunction1_o3_g = L4_MABX_P.TXdeltatime_Y0_bo;
31952
31953 /* SystemInitialize for Outport: '<S1029>/TX delay time' */
31954 L4_MABX_B.SFunction1_o4_ev = L4_MABX_P.TXdelaytime_Y0_lf;
31955
31956 /* End of SystemInitialize for SubSystem: '<S1028>/Std_OdometryData' */
31957 /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_20ms' */
31958
31959 /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */
31960 /* InitializeConditions for UnitDelay: '<S1049>/Unit_Delay' */
31961 L4_MABX_DW.Unit_Delay_DSTATE_ek = L4_MABX_P.Unit_Delay_InitialCondition_k0;
31962
31963 /* InitializeConditions for UnitDelay: '<S1050>/Unit Delay' */
31964 L4_MABX_DW.UnitDelay_DSTATE_h = L4_MABX_P.UnitDelay_InitialCondition_ns;
31965
31966 /* SystemInitialize for Enabled SubSystem: '<S1043>/RQST_13_E4' */
31967 /* SystemInitialize for Outport: '<S1045>/TX status' */
31968 L4_MABX_B.SFunction1_o1_jk = L4_MABX_P.TXstatus_Y0_h;
31969
31970 /* SystemInitialize for Outport: '<S1045>/TX time' */
31971 L4_MABX_B.SFunction1_o2_d = L4_MABX_P.TXtime_Y0_pp;
31972
31973 /* SystemInitialize for Outport: '<S1045>/TX delta time' */
31974 L4_MABX_B.SFunction1_o3_f = L4_MABX_P.TXdeltatime_Y0_bc;
31975
31976 /* SystemInitialize for Outport: '<S1045>/TX delay time' */
31977 L4_MABX_B.SFunction1_o4_h = L4_MABX_P.TXdelaytime_Y0_k;
31978
31979 /* End of SystemInitialize for SubSystem: '<S1043>/RQST_13_E4' */
31980 /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_5000ms' */
31981
31982 /* SystemInitialize for Enabled SubSystem: '<S640>/TC1_03_05' */
31983 /* SystemInitialize for Outport: '<S641>/SPN681_TransGearShiftInhibitReq' */
31984 L4_MABX_B.SFunction1_o1_n5 = L4_MABX_P.SPN681_TransGearShiftInhibitReq;
31985
31986 /* SystemInitialize for Outport: '<S641>/SPN682_TransTrqConvLockupDisReq' */
31987 L4_MABX_B.SFunction1_o2_hw = L4_MABX_P.SPN682_TransTrqConvLockupDisReq;
31988
31989 /* SystemInitialize for Outport: '<S641>/SPN683_DisengageDrivelineReq' */
31990 L4_MABX_B.SFunction1_o3_cg = L4_MABX_P.SPN683_DisengageDrivelineReq_Y0;
31991
31992 /* SystemInitialize for Outport: '<S641>/SPN4242_TransRevGearShiftInhibRq' */
31993 L4_MABX_B.SFunction1_o4_eq = L4_MABX_P.SPN4242_TransRevGearShiftInhibR;
31994
31995 /* SystemInitialize for Outport: '<S641>/SPN684_RequestedPercClutchSlip' */
31996 L4_MABX_B.SFunction1_o5_o = L4_MABX_P.SPN684_RequestedPercClutchSlip_;
31997
31998 /* SystemInitialize for Outport: '<S641>/SPN525_TransRequestedGear' */
31999 L4_MABX_B.SFunction1_o6_c = L4_MABX_P.SPN525_TransRequestedGear_Y0;
32000
32001 /* SystemInitialize for Outport: '<S641>/SPN685_DisengageDiffLockRqFrAx1' */
32002 L4_MABX_B.SFunction1_o7_l = L4_MABX_P.SPN685_DisengageDiffLockRqFrAx1;
32003
32004 /* SystemInitialize for Outport: '<S641>/SPN686_DisengageDiffLockRqFrAx2' */
32005 L4_MABX_B.SFunction1_o8_f = L4_MABX_P.SPN686_DisengageDiffLockRqFrAx2;
32006
32007 /* SystemInitialize for Outport: '<S641>/SPN687_DisengageDiffLockRqRrAx1' */
32008 L4_MABX_B.SFunction1_o9_g = L4_MABX_P.SPN687_DisengageDiffLockRqRrAx1;
32009
32010 /* SystemInitialize for Outport: '<S641>/SPN688_DisengageDiffLockRqRrAx2' */
32011 L4_MABX_B.SFunction1_o10_k = L4_MABX_P.SPN688_DisengageDiffLockRqRrAx2;
32012
32013 /* SystemInitialize for Outport: '<S641>/SPN689_DisengageDiffLockRqC' */
32014 L4_MABX_B.SFunction1_o11 = L4_MABX_P.SPN689_DisengageDiffLockRqC_Y0;
32015
32016 /* SystemInitialize for Outport: '<S641>/SPN690_DisengageDiffLockRqCF' */
32017 L4_MABX_B.SFunction1_o12 = L4_MABX_P.SPN690_DisengageDiffLockRqCF_Y0;
32018
32019 /* SystemInitialize for Outport: '<S641>/SPN691_DisengageDiffLockRqCR' */
32020 L4_MABX_B.SFunction1_o13 = L4_MABX_P.SPN691_DisengageDiffLockRqCR_Y0;
32021
32022 /* SystemInitialize for Outport: '<S641>/SPN5762_TransLoadRedInhibitRq' */
32023 L4_MABX_B.SFunction1_o14 = L4_MABX_P.SPN5762_TransLoadRedInhibitRq_Y;
32024
32025 /* SystemInitialize for Outport: '<S641>/SPN1852_TransmissionMode1' */
32026 L4_MABX_B.SFunction1_o15 = L4_MABX_P.SPN1852_TransmissionMode1_Y0;
32027
32028 /* SystemInitialize for Outport: '<S641>/SPN1853_TransmissionMode2' */
32029 L4_MABX_B.SFunction1_o16 = L4_MABX_P.SPN1853_TransmissionMode2_Y0;
32030
32031 /* SystemInitialize for Outport: '<S641>/SPN1854_TransmissionMode3' */
32032 L4_MABX_B.SFunction1_o17 = L4_MABX_P.SPN1854_TransmissionMode3_Y0;
32033
32034 /* SystemInitialize for Outport: '<S641>/SPN1855_TransmissionMode4' */
32035 L4_MABX_B.SFunction1_o18 = L4_MABX_P.SPN1855_TransmissionMode4_Y0;
32036
32037 /* SystemInitialize for Outport: '<S641>/SPN7695_TransAutoNeutralRequest' */
32038 L4_MABX_B.SFunction1_o19 = L4_MABX_P.SPN7695_TransAutoNeutralRequest;
32039
32040 /* SystemInitialize for Outport: '<S641>/SPN4255_TransRequestedLaunchGear' */
32041 L4_MABX_B.SFunction1_o20 = L4_MABX_P.SPN4255_TransRequestedLaunchGea;
32042
32043 /* SystemInitialize for Outport: '<S641>/SPN2985_TransShiftSelDispModeSw' */
32044 L4_MABX_B.SFunction1_o21 = L4_MABX_P.SPN2985_TransShiftSelDispModeSw;
32045
32046 /* SystemInitialize for Outport: '<S641>/SPN4246_TransmissionMode5' */
32047 L4_MABX_B.SFunction1_o22 = L4_MABX_P.SPN4246_TransmissionMode5_Y0;
32048
32049 /* SystemInitialize for Outport: '<S641>/SPN4247_TransmissionMode6' */
32050 L4_MABX_B.SFunction1_o23 = L4_MABX_P.SPN4247_TransmissionMode6_Y0;
32051
32052 /* SystemInitialize for Outport: '<S641>/SPN4248_TransmissionMode7' */
32053 L4_MABX_B.SFunction1_o24 = L4_MABX_P.SPN4248_TransmissionMode7_Y0;
32054
32055 /* SystemInitialize for Outport: '<S641>/SPN4249_TransmissionMode8' */
32056 L4_MABX_B.SFunction1_o25 = L4_MABX_P.SPN4249_TransmissionMode8_Y0;
32057
32058 /* SystemInitialize for Outport: '<S641>/RX status' */
32059 L4_MABX_B.SFunction1_o26 = L4_MABX_P.RXstatus_Y0_pg;
32060
32061 /* SystemInitialize for Outport: '<S641>/RX time' */
32062 L4_MABX_B.SFunction1_o27 = L4_MABX_P.RXtime_Y0_au;
32063
32064 /* SystemInitialize for Outport: '<S641>/RX delta time' */
32065 L4_MABX_B.SFunction1_o28 = L4_MABX_P.RXdeltatime_Y0_bp;
32066
32067 /* End of SystemInitialize for SubSystem: '<S640>/TC1_03_05' */
32068
32069 /* SystemInitialize for Atomic SubSystem: '<S849>/CAN_TX_50ms' */
32070 /* SystemInitialize for Enabled SubSystem: '<S1054>/CCVS1_E3' */
32071 /* SystemInitialize for Outport: '<S1056>/TX status' */
32072 L4_MABX_B.SFunction1_o1_j = L4_MABX_P.TXstatus_Y0_ge;
32073
32074 /* SystemInitialize for Outport: '<S1056>/TX time' */
32075 L4_MABX_B.SFunction1_o2_ju = L4_MABX_P.TXtime_Y0_ju;
32076
32077 /* SystemInitialize for Outport: '<S1056>/TX delta time' */
32078 L4_MABX_B.SFunction1_o3_d = L4_MABX_P.TXdeltatime_Y0_mb;
32079
32080 /* SystemInitialize for Outport: '<S1056>/TX delay time' */
32081 L4_MABX_B.SFunction1_o4_m = L4_MABX_P.TXdelaytime_Y0_h;
32082
32083 /* End of SystemInitialize for SubSystem: '<S1054>/CCVS1_E3' */
32084
32085 /* SystemInitialize for Enabled SubSystem: '<S1055>/TC1_03_05' */
32086 /* SystemInitialize for Outport: '<S1057>/TX status' */
32087 L4_MABX_B.SFunction1_o1_k = L4_MABX_P.TXstatus_Y0_hk;
32088
32089 /* SystemInitialize for Outport: '<S1057>/TX time' */
32090 L4_MABX_B.SFunction1_o2_p = L4_MABX_P.TXtime_Y0_hu;
32091
32092 /* SystemInitialize for Outport: '<S1057>/TX delta time' */
32093 L4_MABX_B.SFunction1_o3_e = L4_MABX_P.TXdeltatime_Y0_ni;
32094
32095 /* SystemInitialize for Outport: '<S1057>/TX delay time' */
32096 L4_MABX_B.SFunction1_o4_e = L4_MABX_P.TXdelaytime_Y0_kl;
32097
32098 /* End of SystemInitialize for SubSystem: '<S1055>/TC1_03_05' */
32099 /* End of SystemInitialize for SubSystem: '<S849>/CAN_TX_50ms' */
32100
32101 /* SystemInitialize for Enabled SubSystem: '<S638>/SystemTime_01' */
32102 /* SystemInitialize for Outport: '<S639>/SID' */
32103 L4_MABX_B.SFunction1_o1_lg = L4_MABX_P.SID_Y0_km;
32104
32105 /* SystemInitialize for Outport: '<S639>/Source' */
32106 L4_MABX_B.SFunction1_o2_lu = L4_MABX_P.Source_Y0;
32107
32108 /* SystemInitialize for Outport: '<S639>/Date' */
32109 L4_MABX_B.SFunction1_o3_ct = L4_MABX_P.Date_Y0;
32110
32111 /* SystemInitialize for Outport: '<S639>/Time' */
32112 L4_MABX_B.SFunction1_o4_os = L4_MABX_P.Time_Y0;
32113
32114 /* SystemInitialize for Outport: '<S639>/RX status' */
32115 L4_MABX_B.SFunction1_o5_p = L4_MABX_P.RXstatus_Y0_m1;
32116
32117 /* SystemInitialize for Outport: '<S639>/RX time' */
32118 L4_MABX_B.SFunction1_o6_f = L4_MABX_P.RXtime_Y0_eu;
32119
32120 /* SystemInitialize for Outport: '<S639>/RX delta time' */
32121 L4_MABX_B.SFunction1_o7_h = L4_MABX_P.RXdeltatime_Y0_jp;
32122
32123 /* End of SystemInitialize for SubSystem: '<S638>/SystemTime_01' */
32124
32125 /* SystemInitialize for Enabled SubSystem: '<S1067>/Std_SystemTime_01' */
32126 /* SystemInitialize for Outport: '<S1069>/TX status' */
32127 L4_MABX_B.SFunction1_o1_a = L4_MABX_P.TXstatus_Y0_of;
32128
32129 /* SystemInitialize for Outport: '<S1069>/TX time' */
32130 L4_MABX_B.SFunction1_o2_k = L4_MABX_P.TXtime_Y0_ns;
32131
32132 /* SystemInitialize for Outport: '<S1069>/TX delta time' */
32133 L4_MABX_B.SFunction1_o3 = L4_MABX_P.TXdeltatime_Y0_fh;
32134
32135 /* SystemInitialize for Outport: '<S1069>/TX delay time' */
32136 L4_MABX_B.SFunction1_o4 = L4_MABX_P.TXdelaytime_Y0_jc;
32137
32138 /* End of SystemInitialize for SubSystem: '<S1067>/Std_SystemTime_01' */
32139
32140 /* SystemInitialize for Triggered SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' */
32141 /* SystemInitialize for Outport: '<S1064>/TX status' */
32142 L4_MABX_B.SFunction1_o1_h = L4_MABX_P.TXstatus_Y0_gp;
32143
32144 /* SystemInitialize for Outport: '<S1064>/TX time' */
32145 L4_MABX_B.SFunction1_o2_jd = L4_MABX_P.TXtime_Y0_l;
32146
32147 /* SystemInitialize for Outport: '<S1064>/TX delta time' */
32148 L4_MABX_B.SFunction1_o3_h = L4_MABX_P.TXdeltatime_Y0_c;
32149
32150 /* SystemInitialize for Outport: '<S1064>/TX delay time' */
32151 L4_MABX_B.SFunction1_o4_p = L4_MABX_P.TXdelaytime_Y0_pz;
32152
32153 /* End of SystemInitialize for SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' */
32154
32155 /* SystemInitialize for Triggered SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' */
32156 /* SystemInitialize for Outport: '<S1065>/TX status' */
32157 L4_MABX_B.SFunction1_o1_ac = L4_MABX_P.TXstatus_Y0_ha;
32158
32159 /* SystemInitialize for Outport: '<S1065>/TX time' */
32160 L4_MABX_B.SFunction1_o2_br = L4_MABX_P.TXtime_Y0_c;
32161
32162 /* SystemInitialize for Outport: '<S1065>/TX delta time' */
32163 L4_MABX_B.SFunction1_o3_m = L4_MABX_P.TXdeltatime_Y0_k;
32164
32165 /* SystemInitialize for Outport: '<S1065>/TX delay time' */
32166 L4_MABX_B.SFunction1_o4_j = L4_MABX_P.TXdelaytime_Y0_d2;
32167
32168 /* End of SystemInitialize for SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' */
32169
32170 /* SystemInitialize for Chart: '<S859>/Chart' */
32171 L4_MABX_DW.temporalCounter_i1_p = 0U;
32172 L4_MABX_DW.is_active_c4_SUB_ECU_L4_MABX_HW = 0U;
32173 L4_MABX_DW.is_c4_SUB_ECU_L4_MABX_HW_Interf = L4_MABX_IN_NO_ACTIVE_CHILD;
32174
32175 /* SystemInitialize for Enabled SubSystem: '<S573>/GNSSDOPs_011' */
32176 /* SystemInitialize for Outport: '<S574>/SID' */
32177 L4_MABX_B.SFunction1_o1_nf = L4_MABX_P.SID_Y0_k5;
32178
32179 /* SystemInitialize for Outport: '<S574>/SetMode' */
32180 L4_MABX_B.SFunction1_o2_mj = L4_MABX_P.SetMode_Y0;
32181
32182 /* SystemInitialize for Outport: '<S574>/OpMode' */
32183 L4_MABX_B.SFunction1_o3_l3 = L4_MABX_P.OpMode_Y0;
32184
32185 /* SystemInitialize for Outport: '<S574>/HDOP_' */
32186 L4_MABX_B.SFunction1_o4_eg = L4_MABX_P.HDOP_Y0;
32187
32188 /* SystemInitialize for Outport: '<S574>/VDOP' */
32189 L4_MABX_B.SFunction1_o5_pl = L4_MABX_P.VDOP_Y0;
32190
32191 /* SystemInitialize for Outport: '<S574>/TDOP' */
32192 L4_MABX_B.SFunction1_o6_d = L4_MABX_P.TDOP_Y0;
32193
32194 /* SystemInitialize for Outport: '<S574>/RX status' */
32195 L4_MABX_B.SFunction1_o7_g = L4_MABX_P.RXstatus_Y0_f;
32196
32197 /* SystemInitialize for Outport: '<S574>/RX time' */
32198 L4_MABX_B.SFunction1_o8_a4 = L4_MABX_P.RXtime_Y0_bw;
32199
32200 /* SystemInitialize for Outport: '<S574>/RX delta time' */
32201 L4_MABX_B.SFunction1_o9_p = L4_MABX_P.RXdeltatime_Y0_ho;
32202
32203 /* End of SystemInitialize for SubSystem: '<S573>/GNSSDOPs_011' */
32204
32205 /* SystemInitialize for Enabled SubSystem: '<S573>/GNSSDOPs_1' */
32206 /* SystemInitialize for Outport: '<S575>/SID' */
32207 L4_MABX_B.SFunction1_o1_lr = L4_MABX_P.SID_Y0_l;
32208
32209 /* SystemInitialize for Outport: '<S575>/SetMode' */
32210 L4_MABX_B.SFunction1_o2_mt = L4_MABX_P.SetMode_Y0_l;
32211
32212 /* SystemInitialize for Outport: '<S575>/OpMode' */
32213 L4_MABX_B.SFunction1_o3_m3 = L4_MABX_P.OpMode_Y0_n;
32214
32215 /* SystemInitialize for Outport: '<S575>/HDOP_' */
32216 L4_MABX_B.SFunction1_o4_ey = L4_MABX_P.HDOP_Y0_h;
32217
32218 /* SystemInitialize for Outport: '<S575>/VDOP' */
32219 L4_MABX_B.SFunction1_o5_g5 = L4_MABX_P.VDOP_Y0_n;
32220
32221 /* SystemInitialize for Outport: '<S575>/TDOP' */
32222 L4_MABX_B.SFunction1_o6_b = L4_MABX_P.TDOP_Y0_c;
32223
32224 /* SystemInitialize for Outport: '<S575>/RX status' */
32225 L4_MABX_B.SFunction1_o7_jo = L4_MABX_P.RXstatus_Y0_mr;
32226
32227 /* SystemInitialize for Outport: '<S575>/RX time' */
32228 L4_MABX_B.SFunction1_o8_pc = L4_MABX_P.RXtime_Y0_aw;
32229
32230 /* SystemInitialize for Outport: '<S575>/RX delta time' */
32231 L4_MABX_B.SFunction1_o9_k = L4_MABX_P.RXdeltatime_Y0_kj;
32232
32233 /* End of SystemInitialize for SubSystem: '<S573>/GNSSDOPs_1' */
32234
32235 /* SystemInitialize for Atomic SubSystem: '<S65>/Task_20ms' */
32236 /* InitializeConditions for UnitDelay: '<S395>/Unit Delay1' */
32237 L4_MABX_DW.UnitDelay1_DSTATE = L4_MABX_P.UnitDelay1_InitialCondition_p;
32238
32239 /* InitializeConditions for DiscreteIntegrator: '<S396>/LongitudnalPosition' */
32240 L4_MABX_DW.LongitudnalPosition_DSTATE = L4_MABX_B.InitialPosition;
32241 L4_MABX_DW.LongitudnalPosition_PrevResetSt = 2;
32242
32243 /* InitializeConditions for DiscreteIntegrator: '<S396>/VehHeading' */
32244 L4_MABX_DW.VehHeading_DSTATE = L4_MABX_B.InitialHeading;
32245 L4_MABX_DW.VehHeading_PrevResetState = 2;
32246
32247 /* InitializeConditions for DiscreteIntegrator: '<S396>/XPosition' */
32248 L4_MABX_DW.XPosition_DSTATE = L4_MABX_B.InitialXPosition;
32249 L4_MABX_DW.XPosition_PrevResetState = 2;
32250
32251 /* InitializeConditions for DiscreteIntegrator: '<S396>/YPosition' */
32252 L4_MABX_DW.YPosition_DSTATE = L4_MABX_B.InitialYPosition;
32253 L4_MABX_DW.YPosition_PrevResetState = 2;
32254
32255 /* End of SystemInitialize for SubSystem: '<S65>/Task_20ms' */
32256
32257 /* SystemInitialize for S-Function (rti_commonblock): '<S408>/S-Function1' incorporates:
32258 * SubSystem: '<S399>/Background_Task'
32259 */
32260 L4_MAB_Background_Task_Init();
32261
32262 /* End of SystemInitialize for S-Function (rti_commonblock): '<S408>/S-Function1' */
32263
32264 /* SystemInitialize for S-Function (rti_commonblock): '<S414>/S-Function1' incorporates:
32265 * SubSystem: '<S399>/Interrupt_Task'
32266 */
32267 L4_MABX_Interrupt_Task_Init();
32268
32269 /* End of SystemInitialize for S-Function (rti_commonblock): '<S414>/S-Function1' */
32270
32271 /* SystemInitialize for Enabled SubSystem: '<S495>/AEBS1_A0' */
32272 /* SystemInitialize for Outport: '<S496>/AdvEmergencyBrkSysState' */
32273 L4_MABX_B.SFunction1_o1_of = L4_MABX_P.AdvEmergencyBrkSysState_Y0;
32274
32275 /* SystemInitialize for Outport: '<S496>/CollisionWarningLevel' */
32276 L4_MABX_B.SFunction1_o2_l0 = L4_MABX_P.CollisionWarningLevel_Y0;
32277
32278 /* SystemInitialize for Outport: '<S496>/RelObjctDetForAdvEmergBrakingSys' */
32279 L4_MABX_B.SFunction1_o3_ok = L4_MABX_P.RelObjctDetForAdvEmergBrakingSy;
32280
32281 /* SystemInitialize for Outport: '<S496>/BendOffProbabOfRelevantObject' */
32282 L4_MABX_B.SFunction1_o4_ae = L4_MABX_P.BendOffProbabOfRelevantObject_Y;
32283
32284 /* SystemInitialize for Outport: '<S496>/TimeToCollisionWithRelevantObj' */
32285 L4_MABX_B.SFunction1_o5_e2 = L4_MABX_P.TimeToCollisionWithRelevantObj_;
32286
32287 /* SystemInitialize for Outport: '<S496>/RX status' */
32288 L4_MABX_B.SFunction1_o6_oj = L4_MABX_P.RXstatus_Y0_c;
32289
32290 /* SystemInitialize for Outport: '<S496>/RX time' */
32291 L4_MABX_B.SFunction1_o7_fc = L4_MABX_P.RXtime_Y0_l;
32292
32293 /* SystemInitialize for Outport: '<S496>/RX delta time' */
32294 L4_MABX_B.SFunction1_o8_lf = L4_MABX_P.RXdeltatime_Y0_j;
32295
32296 /* End of SystemInitialize for SubSystem: '<S495>/AEBS1_A0' */
32297
32298 /* SystemInitialize for Enabled SubSystem: '<S501>/B2' */
32299 /* SystemInitialize for Outport: '<S502>/BrakeAppPressDemanded' */
32300 L4_MABX_B.SFunction1_o1_m2 = L4_MABX_P.BrakeAppPressDemanded_Y0;
32301
32302 /* SystemInitialize for Outport: '<S502>/BrakeSwitch2' */
32303 L4_MABX_B.SFunction1_o2_fs = L4_MABX_P.BrakeSwitch2_Y0;
32304
32305 /* SystemInitialize for Outport: '<S502>/RX status' */
32306 L4_MABX_B.SFunction1_o3_j5c = L4_MABX_P.RXstatus_Y0_b;
32307
32308 /* SystemInitialize for Outport: '<S502>/RX time' */
32309 L4_MABX_B.SFunction1_o4_fzy = L4_MABX_P.RXtime_Y0_d;
32310
32311 /* SystemInitialize for Outport: '<S502>/RX delta time' */
32312 L4_MABX_B.SFunction1_o5_j = L4_MABX_P.RXdeltatime_Y0_p;
32313
32314 /* End of SystemInitialize for SubSystem: '<S501>/B2' */
32315
32316 /* SystemInitialize for Enabled SubSystem: '<S503>/Tracks' */
32317 /* SystemInitialize for Outport: '<S504>/tr0_track_selection_status' */
32318 L4_MABX_B.SFunction1_o1_cy = L4_MABX_P.tr0_track_selection_status_Y0;
32319
32320 /* SystemInitialize for Outport: '<S504>/tr0_corrected_lateral_distance' */
32321 L4_MABX_B.SFunction1_o2_dt = L4_MABX_P.tr0_corrected_lateral_distance_;
32322
32323 /* SystemInitialize for Outport: '<S504>/tr1_track_selection_status' */
32324 L4_MABX_B.SFunction1_o3_lj = L4_MABX_P.tr1_track_selection_status_Y0;
32325
32326 /* SystemInitialize for Outport: '<S504>/tr1_corrected_lateral_distance' */
32327 L4_MABX_B.SFunction1_o4_aa = L4_MABX_P.tr1_corrected_lateral_distance_;
32328
32329 /* SystemInitialize for Outport: '<S504>/tr2_track_selection_status' */
32330 L4_MABX_B.SFunction1_o5_bi = L4_MABX_P.tr2_track_selection_status_Y0;
32331
32332 /* SystemInitialize for Outport: '<S504>/tr2_corrected_lateral_distance' */
32333 L4_MABX_B.SFunction1_o6_ny = L4_MABX_P.tr2_corrected_lateral_distance_;
32334
32335 /* SystemInitialize for Outport: '<S504>/tr3_track_selection_status' */
32336 L4_MABX_B.SFunction1_o7_nm = L4_MABX_P.tr3_track_selection_status_Y0;
32337
32338 /* SystemInitialize for Outport: '<S504>/tr3_corrected_lateral_distance' */
32339 L4_MABX_B.SFunction1_o8_pi = L4_MABX_P.tr3_corrected_lateral_distance_;
32340
32341 /* SystemInitialize for Outport: '<S504>/tr4_track_selection_status' */
32342 L4_MABX_B.SFunction1_o9_c2 = L4_MABX_P.tr4_track_selection_status_Y0;
32343
32344 /* SystemInitialize for Outport: '<S504>/tr4_corrected_lateral_distance' */
32345 L4_MABX_B.SFunction1_o10_b = L4_MABX_P.tr4_corrected_lateral_distance_;
32346
32347 /* SystemInitialize for Outport: '<S504>/tr5_track_selection_status' */
32348 L4_MABX_B.SFunction1_o11_h2 = L4_MABX_P.tr5_track_selection_status_Y0;
32349
32350 /* SystemInitialize for Outport: '<S504>/tr5_corrected_lateral_distance' */
32351 L4_MABX_B.SFunction1_o12_dj = L4_MABX_P.tr5_corrected_lateral_distance_;
32352
32353 /* SystemInitialize for Outport: '<S504>/tr6_track_selection_status' */
32354 L4_MABX_B.SFunction1_o13_n = L4_MABX_P.tr6_track_selection_status_Y0;
32355
32356 /* SystemInitialize for Outport: '<S504>/tr6_corrected_lateral_distance' */
32357 L4_MABX_B.SFunction1_o14_ed = L4_MABX_P.tr6_corrected_lateral_distance_;
32358
32359 /* SystemInitialize for Outport: '<S504>/tr7_track_selection_status' */
32360 L4_MABX_B.SFunction1_o15_e2 = L4_MABX_P.tr7_track_selection_status_Y0;
32361
32362 /* SystemInitialize for Outport: '<S504>/tr7_corrected_lateral_distance' */
32363 L4_MABX_B.SFunction1_o16_i = L4_MABX_P.tr7_corrected_lateral_distance_;
32364
32365 /* SystemInitialize for Outport: '<S504>/tr8_track_selection_status' */
32366 L4_MABX_B.SFunction1_o17_o = L4_MABX_P.tr8_track_selection_status_Y0;
32367
32368 /* SystemInitialize for Outport: '<S504>/tr8_corrected_lateral_distance' */
32369 L4_MABX_B.SFunction1_o18_p = L4_MABX_P.tr8_corrected_lateral_distance_;
32370
32371 /* SystemInitialize for Outport: '<S504>/tr9_track_selection_status' */
32372 L4_MABX_B.SFunction1_o19_o = L4_MABX_P.tr9_track_selection_status_Y0;
32373
32374 /* SystemInitialize for Outport: '<S504>/tr9_corrected_lateral_distance' */
32375 L4_MABX_B.SFunction1_o20_i = L4_MABX_P.tr9_corrected_lateral_distance_;
32376
32377 /* SystemInitialize for Outport: '<S504>/tr0_lateral_position' */
32378 L4_MABX_B.SFunction1_o21_b = L4_MABX_P.tr0_lateral_position_Y0;
32379
32380 /* SystemInitialize for Outport: '<S504>/tr1_lateral_position' */
32381 L4_MABX_B.SFunction1_o22_i = L4_MABX_P.tr1_lateral_position_Y0;
32382
32383 /* SystemInitialize for Outport: '<S504>/tr2_lateral_position' */
32384 L4_MABX_B.SFunction1_o23_j = L4_MABX_P.tr2_lateral_position_Y0;
32385
32386 /* SystemInitialize for Outport: '<S504>/tr3_lateral_position' */
32387 L4_MABX_B.SFunction1_o24_j = L4_MABX_P.tr3_lateral_position_Y0;
32388
32389 /* SystemInitialize for Outport: '<S504>/tr4_lateral_position' */
32390 L4_MABX_B.SFunction1_o25_e = L4_MABX_P.tr4_lateral_position_Y0;
32391
32392 /* SystemInitialize for Outport: '<S504>/tr5_lateral_position' */
32393 L4_MABX_B.SFunction1_o26_c = L4_MABX_P.tr5_lateral_position_Y0;
32394
32395 /* SystemInitialize for Outport: '<S504>/tr6_lateral_position' */
32396 L4_MABX_B.SFunction1_o27_e = L4_MABX_P.tr6_lateral_position_Y0;
32397
32398 /* SystemInitialize for Outport: '<S504>/tr7_lateral_position' */
32399 L4_MABX_B.SFunction1_o28_n = L4_MABX_P.tr7_lateral_position_Y0;
32400
32401 /* SystemInitialize for Outport: '<S504>/tr8_lateral_position' */
32402 L4_MABX_B.SFunction1_o29 = L4_MABX_P.tr8_lateral_position_Y0;
32403
32404 /* SystemInitialize for Outport: '<S504>/tr9_lateral_position' */
32405 L4_MABX_B.SFunction1_o30 = L4_MABX_P.tr9_lateral_position_Y0;
32406
32407 /* SystemInitialize for Outport: '<S504>/tr0_range' */
32408 L4_MABX_B.SFunction1_o31 = L4_MABX_P.tr0_range_Y0;
32409
32410 /* SystemInitialize for Outport: '<S504>/tr1_range' */
32411 L4_MABX_B.SFunction1_o32 = L4_MABX_P.tr1_range_Y0;
32412
32413 /* SystemInitialize for Outport: '<S504>/tr2_range' */
32414 L4_MABX_B.SFunction1_o33 = L4_MABX_P.tr2_range_Y0;
32415
32416 /* SystemInitialize for Outport: '<S504>/tr3_range' */
32417 L4_MABX_B.SFunction1_o34 = L4_MABX_P.tr3_range_Y0;
32418
32419 /* SystemInitialize for Outport: '<S504>/tr4_range' */
32420 L4_MABX_B.SFunction1_o35 = L4_MABX_P.tr4_range_Y0;
32421
32422 /* SystemInitialize for Outport: '<S504>/tr5_range' */
32423 L4_MABX_B.SFunction1_o36 = L4_MABX_P.tr5_range_Y0;
32424
32425 /* SystemInitialize for Outport: '<S504>/tr6_range' */
32426 L4_MABX_B.SFunction1_o37 = L4_MABX_P.tr6_range_Y0;
32427
32428 /* SystemInitialize for Outport: '<S504>/tr7_range' */
32429 L4_MABX_B.SFunction1_o38 = L4_MABX_P.tr7_range_Y0;
32430
32431 /* SystemInitialize for Outport: '<S504>/tr8_range' */
32432 L4_MABX_B.SFunction1_o39 = L4_MABX_P.tr8_range_Y0;
32433
32434 /* SystemInitialize for Outport: '<S504>/tr9_range' */
32435 L4_MABX_B.SFunction1_o40 = L4_MABX_P.tr9_range_Y0;
32436
32437 /* SystemInitialize for Outport: '<S504>/tr0_radar_confidence' */
32438 L4_MABX_B.SFunction1_o41 = L4_MABX_P.tr0_radar_confidence_Y0;
32439
32440 /* SystemInitialize for Outport: '<S504>/tr1_radar_confidence' */
32441 L4_MABX_B.SFunction1_o42 = L4_MABX_P.tr1_radar_confidence_Y0;
32442
32443 /* SystemInitialize for Outport: '<S504>/tr2_radar_confidence' */
32444 L4_MABX_B.SFunction1_o43 = L4_MABX_P.tr2_radar_confidence_Y0;
32445
32446 /* SystemInitialize for Outport: '<S504>/tr3_radar_confidence' */
32447 L4_MABX_B.SFunction1_o44 = L4_MABX_P.tr3_radar_confidence_Y0;
32448
32449 /* SystemInitialize for Outport: '<S504>/tr4_radar_confidence' */
32450 L4_MABX_B.SFunction1_o45 = L4_MABX_P.tr4_radar_confidence_Y0;
32451
32452 /* SystemInitialize for Outport: '<S504>/tr5_radar_confidence' */
32453 L4_MABX_B.SFunction1_o46 = L4_MABX_P.tr5_radar_confidence_Y0;
32454
32455 /* SystemInitialize for Outport: '<S504>/tr6_radar_confidence' */
32456 L4_MABX_B.SFunction1_o47 = L4_MABX_P.tr6_radar_confidence_Y0;
32457
32458 /* SystemInitialize for Outport: '<S504>/tr7_radar_confidence' */
32459 L4_MABX_B.SFunction1_o48 = L4_MABX_P.tr7_radar_confidence_Y0;
32460
32461 /* SystemInitialize for Outport: '<S504>/tr8_radar_confidence' */
32462 L4_MABX_B.SFunction1_o49 = L4_MABX_P.tr8_radar_confidence_Y0;
32463
32464 /* SystemInitialize for Outport: '<S504>/tr9_radar_confidence' */
32465 L4_MABX_B.SFunction1_o50 = L4_MABX_P.tr9_radar_confidence_Y0;
32466
32467 /* SystemInitialize for Outport: '<S504>/tr0_relative_velocitiy' */
32468 L4_MABX_B.SFunction1_o51 = L4_MABX_P.tr0_relative_velocitiy_Y0;
32469
32470 /* SystemInitialize for Outport: '<S504>/tr0_acceleration_over_ground' */
32471 L4_MABX_B.SFunction1_o52 = L4_MABX_P.tr0_acceleration_over_ground_Y0;
32472
32473 /* SystemInitialize for Outport: '<S504>/tr1_relative_velocitiy' */
32474 L4_MABX_B.SFunction1_o53 = L4_MABX_P.tr1_relative_velocitiy_Y0;
32475
32476 /* SystemInitialize for Outport: '<S504>/tr1_acceleration_over_ground' */
32477 L4_MABX_B.SFunction1_o54 = L4_MABX_P.tr1_acceleration_over_ground_Y0;
32478
32479 /* SystemInitialize for Outport: '<S504>/tr2_relative_velocitiy' */
32480 L4_MABX_B.SFunction1_o55 = L4_MABX_P.tr2_relative_velocitiy_Y0;
32481
32482 /* SystemInitialize for Outport: '<S504>/tr2_acceleration_over_ground' */
32483 L4_MABX_B.SFunction1_o56 = L4_MABX_P.tr2_acceleration_over_ground_Y0;
32484
32485 /* SystemInitialize for Outport: '<S504>/tr3_relative_velocitiy' */
32486 L4_MABX_B.SFunction1_o57 = L4_MABX_P.tr3_relative_velocitiy_Y0;
32487
32488 /* SystemInitialize for Outport: '<S504>/tr3_acceleration_over_ground' */
32489 L4_MABX_B.SFunction1_o58 = L4_MABX_P.tr3_acceleration_over_ground_Y0;
32490
32491 /* SystemInitialize for Outport: '<S504>/tr4_relative_velocitiy' */
32492 L4_MABX_B.SFunction1_o59 = L4_MABX_P.tr4_relative_velocitiy_Y0;
32493
32494 /* SystemInitialize for Outport: '<S504>/tr4_acceleration_over_ground' */
32495 L4_MABX_B.SFunction1_o60 = L4_MABX_P.tr4_acceleration_over_ground_Y0;
32496
32497 /* SystemInitialize for Outport: '<S504>/tr5_relative_velocitiy' */
32498 L4_MABX_B.SFunction1_o61 = L4_MABX_P.tr5_relative_velocitiy_Y0;
32499
32500 /* SystemInitialize for Outport: '<S504>/tr5_acceleration_over_ground' */
32501 L4_MABX_B.SFunction1_o62 = L4_MABX_P.tr5_acceleration_over_ground_Y0;
32502
32503 /* SystemInitialize for Outport: '<S504>/tr6_relative_velocitiy' */
32504 L4_MABX_B.SFunction1_o63 = L4_MABX_P.tr6_relative_velocitiy_Y0;
32505
32506 /* SystemInitialize for Outport: '<S504>/tr6_acceleration_over_ground' */
32507 L4_MABX_B.SFunction1_o64 = L4_MABX_P.tr6_acceleration_over_ground_Y0;
32508
32509 /* SystemInitialize for Outport: '<S504>/tr7_relative_velocitiy' */
32510 L4_MABX_B.SFunction1_o65 = L4_MABX_P.tr7_relative_velocitiy_Y0;
32511
32512 /* SystemInitialize for Outport: '<S504>/tr7_acceleration_over_ground' */
32513 L4_MABX_B.SFunction1_o66 = L4_MABX_P.tr7_acceleration_over_ground_Y0;
32514
32515 /* SystemInitialize for Outport: '<S504>/tr8_relative_velocitiy' */
32516 L4_MABX_B.SFunction1_o67 = L4_MABX_P.tr8_relative_velocitiy_Y0;
32517
32518 /* SystemInitialize for Outport: '<S504>/tr8_acceleration_over_ground' */
32519 L4_MABX_B.SFunction1_o68 = L4_MABX_P.tr8_acceleration_over_ground_Y0;
32520
32521 /* SystemInitialize for Outport: '<S504>/tr9_relative_velocitiy' */
32522 L4_MABX_B.SFunction1_o69 = L4_MABX_P.tr9_relative_velocitiy_Y0;
32523
32524 /* SystemInitialize for Outport: '<S504>/tr9_acceleration_over_ground' */
32525 L4_MABX_B.SFunction1_o70 = L4_MABX_P.tr9_acceleration_over_ground_Y0;
32526
32527 /* SystemInitialize for Outport: '<S504>/track_multiplexor' */
32528 L4_MABX_B.SFunction1_o71 = L4_MABX_P.track_multiplexor_Y0;
32529
32530 /* SystemInitialize for Outport: '<S504>/RX status' */
32531 L4_MABX_B.SFunction1_o72 = L4_MABX_P.RXstatus_Y0_dd;
32532
32533 /* SystemInitialize for Outport: '<S504>/RX time' */
32534 L4_MABX_B.SFunction1_o73 = L4_MABX_P.RXtime_Y0_o;
32535
32536 /* SystemInitialize for Outport: '<S504>/RX delta time' */
32537 L4_MABX_B.SFunction1_o74 = L4_MABX_P.RXdeltatime_Y0_pz;
32538
32539 /* End of SystemInitialize for SubSystem: '<S503>/Tracks' */
32540
32541 /* SystemInitialize for Enabled SubSystem: '<S514>/EBC1_0B' */
32542 /* SystemInitialize for Outport: '<S515>/ASREngCtrlActive' */
32543 L4_MABX_B.SFunction1_o1_fp = L4_MABX_P.ASREngCtrlActive_Y0;
32544
32545 /* SystemInitialize for Outport: '<S515>/ASRBrakeCtrlActive' */
32546 L4_MABX_B.SFunction1_o2_fr = L4_MABX_P.ASRBrakeCtrlActive_Y0;
32547
32548 /* SystemInitialize for Outport: '<S515>/AntiLockBrakingActive' */
32549 L4_MABX_B.SFunction1_o3_ja = L4_MABX_P.AntiLockBrakingActive_Y0;
32550
32551 /* SystemInitialize for Outport: '<S515>/EBSBrakeSwitch' */
32552 L4_MABX_B.SFunction1_o4_f4 = L4_MABX_P.EBSBrakeSwitch_Y0;
32553
32554 /* SystemInitialize for Outport: '<S515>/BrakePedalPos' */
32555 L4_MABX_B.SFunction1_o5_ld = L4_MABX_P.BrakePedalPos_Y0;
32556
32557 /* SystemInitialize for Outport: '<S515>/ABSOffroadSwitch' */
32558 L4_MABX_B.SFunction1_o6_n3 = L4_MABX_P.ABSOffroadSwitch_Y0;
32559
32560 /* SystemInitialize for Outport: '<S515>/ASROffroadSwitch' */
32561 L4_MABX_B.SFunction1_o7_e = L4_MABX_P.ASROffroadSwitch_Y0;
32562
32563 /* SystemInitialize for Outport: '<S515>/ASRHillHolderSwitch' */
32564 L4_MABX_B.SFunction1_o8_e = L4_MABX_P.ASRHillHolderSwitch_Y0;
32565
32566 /* SystemInitialize for Outport: '<S515>/TractionCtrlOverrideSwitch' */
32567 L4_MABX_B.SFunction1_o9_ia = L4_MABX_P.TractionCtrlOverrideSwitch_Y0;
32568
32569 /* SystemInitialize for Outport: '<S515>/AccelInterlockSwitch' */
32570 L4_MABX_B.SFunction1_o10_f5 = L4_MABX_P.AccelInterlockSwitch_Y0;
32571
32572 /* SystemInitialize for Outport: '<S515>/EngDerateSwitch' */
32573 L4_MABX_B.SFunction1_o11_d = L4_MABX_P.EngDerateSwitch_Y0;
32574
32575 /* SystemInitialize for Outport: '<S515>/EngAuxShutdownSwitch' */
32576 L4_MABX_B.SFunction1_o12_a = L4_MABX_P.EngAuxShutdownSwitch_Y0;
32577
32578 /* SystemInitialize for Outport: '<S515>/RemoteAccelEnableSwitch' */
32579 L4_MABX_B.SFunction1_o13_k = L4_MABX_P.RemoteAccelEnableSwitch_Y0;
32580
32581 /* SystemInitialize for Outport: '<S515>/EngRetarderSelection' */
32582 L4_MABX_B.SFunction1_o14_g = L4_MABX_P.EngRetarderSelection_Y0;
32583
32584 /* SystemInitialize for Outport: '<S515>/ABSFullyOperational' */
32585 L4_MABX_B.SFunction1_o15_e = L4_MABX_P.ABSFullyOperational_Y0;
32586
32587 /* SystemInitialize for Outport: '<S515>/EBSRedWarningSignal' */
32588 L4_MABX_B.SFunction1_o16_h = L4_MABX_P.EBSRedWarningSignal_Y0;
32589
32590 /* SystemInitialize for Outport: '<S515>/ABS_EBSAmberWarningSignal' */
32591 L4_MABX_B.SFunction1_o17_n = L4_MABX_P.ABS_EBSAmberWarningSignal_Y0;
32592
32593 /* SystemInitialize for Outport: '<S515>/ATC_ASRInformationSignal' */
32594 L4_MABX_B.SFunction1_o18_h = L4_MABX_P.ATC_ASRInformationSignal_Y0;
32595
32596 /* SystemInitialize for Outport: '<S515>/SrcAddrssOfCtrllngDvcFrBrkCntrl' */
32597 L4_MABX_B.SFunction1_o19_n = L4_MABX_P.SrcAddrssOfCtrllngDvcFrBrkCntrl;
32598
32599 /* SystemInitialize for Outport: '<S515>/HaltBrakeSwitch' */
32600 L4_MABX_B.SFunction1_o20_d = L4_MABX_P.HaltBrakeSwitch_Y0;
32601
32602 /* SystemInitialize for Outport: '<S515>/TrailerABSStatus' */
32603 L4_MABX_B.SFunction1_o21_a = L4_MABX_P.TrailerABSStatus_Y0;
32604
32605 /* SystemInitialize for Outport: '<S515>/TrctrMntdTrilerABSWarningSignal' */
32606 L4_MABX_B.SFunction1_o22_o = L4_MABX_P.TrctrMntdTrilerABSWarningSignal;
32607
32608 /* SystemInitialize for Outport: '<S515>/RX status' */
32609 L4_MABX_B.SFunction1_o23_k = L4_MABX_P.RXstatus_Y0_h;
32610
32611 /* SystemInitialize for Outport: '<S515>/RX time' */
32612 L4_MABX_B.SFunction1_o24_l = L4_MABX_P.RXtime_Y0_br;
32613
32614 /* SystemInitialize for Outport: '<S515>/RX delta time' */
32615 L4_MABX_B.SFunction1_o25_n = L4_MABX_P.RXdeltatime_Y0_a;
32616
32617 /* End of SystemInitialize for SubSystem: '<S514>/EBC1_0B' */
32618
32619 /* SystemInitialize for Enabled SubSystem: '<S567>/EEC2_001' */
32620 /* SystemInitialize for Outport: '<S568>/SPN558_AccelPed1LowIdlSwitch' */
32621 L4_MABX_B.SFunction1_o1_dx = L4_MABX_P.SPN558_AccelPed1LowIdlSwitch_Y0;
32622
32623 /* SystemInitialize for Outport: '<S568>/SPN559_AccelPedKickdownSw' */
32624 L4_MABX_B.SFunction1_o2_h1 = L4_MABX_P.SPN559_AccelPedKickdownSw_Y0;
32625
32626 /* SystemInitialize for Outport: '<S568>/SPN1437_RoadSpeedLimitStatus' */
32627 L4_MABX_B.SFunction1_o3_ee = L4_MABX_P.SPN1437_RoadSpeedLimitStatus_Y0;
32628
32629 /* SystemInitialize for Outport: '<S568>/SPN2970_AccelPed2LowIdlSwitch' */
32630 L4_MABX_B.SFunction1_o4_gk = L4_MABX_P.SPN2970_AccelPed2LowIdlSwitch_Y;
32631
32632 /* SystemInitialize for Outport: '<S568>/SPN91_AccelPedPos1' */
32633 L4_MABX_B.SFunction1_o5_m2 = L4_MABX_P.SPN91_AccelPedPos1_Y0;
32634
32635 /* SystemInitialize for Outport: '<S568>/SPN92_EngPercLoadAtCurrSpd' */
32636 L4_MABX_B.SFunction1_o6_k = L4_MABX_P.SPN92_EngPercLoadAtCurrSpd_Y0;
32637
32638 /* SystemInitialize for Outport: '<S568>/SPN974_RemAccelPedalPosition' */
32639 L4_MABX_B.SFunction1_o7_oo = L4_MABX_P.SPN974_RemAccelPedalPosition_Y0;
32640
32641 /* SystemInitialize for Outport: '<S568>/SPN29_AccelPedPos2' */
32642 L4_MABX_B.SFunction1_o8_a2 = L4_MABX_P.SPN29_AccelPedPos2_Y0;
32643
32644 /* SystemInitialize for Outport: '<S568>/SPN2979_VehAccelRateLimStatus' */
32645 L4_MABX_B.SFunction1_o9_ge = L4_MABX_P.SPN2979_VehAccelRateLimStatus_Y;
32646
32647 /* SystemInitialize for Outport: '<S568>/SPN5021_MomEngMaxPwrEnFdbk' */
32648 L4_MABX_B.SFunction1_o10_f = L4_MABX_P.SPN5021_MomEngMaxPwrEnFdbk_Y0;
32649
32650 /* SystemInitialize for Outport: '<S568>/SPN5399_DPFThermMgmtActive' */
32651 L4_MABX_B.SFunction1_o11_n = L4_MABX_P.SPN5399_DPFThermMgmtActive_Y0;
32652
32653 /* SystemInitialize for Outport: '<S568>/SPN5400_SCRThermMgmtActive' */
32654 L4_MABX_B.SFunction1_o12_p = L4_MABX_P.SPN5400_SCRThermMgmtActive_Y0;
32655
32656 /* SystemInitialize for Outport: '<S568>/SPN3357_ActMaxAvailEngPercTrq' */
32657 L4_MABX_B.SFunction1_o13_h = L4_MABX_P.SPN3357_ActMaxAvailEngPercTrq_Y;
32658
32659 /* SystemInitialize for Outport: '<S568>/SPN5398_EstPumpingPercentTorque' */
32660 L4_MABX_B.SFunction1_o14_p = L4_MABX_P.SPN5398_EstPumpingPercentTorque;
32661
32662 /* SystemInitialize for Outport: '<S568>/RX status' */
32663 L4_MABX_B.SFunction1_o15_p = L4_MABX_P.RXstatus_Y0_lj;
32664
32665 /* SystemInitialize for Outport: '<S568>/RX time' */
32666 L4_MABX_B.SFunction1_o16_n = L4_MABX_P.RXtime_Y0_c;
32667
32668 /* SystemInitialize for Outport: '<S568>/RX delta time' */
32669 L4_MABX_B.SFunction1_o17_p = L4_MABX_P.RXdeltatime_Y0_dj;
32670
32671 /* End of SystemInitialize for SubSystem: '<S567>/EEC2_001' */
32672
32673 /* SystemInitialize for Enabled SubSystem: '<S608>/CAN_TYPE1_RX_M1_C1' */
32674 /* SystemInitialize for Outport: '<S612>/EPBPCMInhibitStatusFeedback' */
32675 L4_MABX_B.SFunction1_o1_a54 = L4_MABX_P.EPBPCMInhibitStatusFeedback_Y0;
32676
32677 /* SystemInitialize for Outport: '<S612>/EPBPCMManualStatusFeedback' */
32678 L4_MABX_B.SFunction1_o2_kd = L4_MABX_P.EPBPCMManualStatusFeedback_Y0;
32679
32680 /* SystemInitialize for Outport: '<S612>/RX status' */
32681 L4_MABX_B.SFunction1_o3_ek = L4_MABX_P.RXstatus_Y0_js;
32682
32683 /* SystemInitialize for Outport: '<S612>/RX time' */
32684 L4_MABX_B.SFunction1_o4_ex = L4_MABX_P.RXtime_Y0_pw;
32685
32686 /* SystemInitialize for Outport: '<S612>/RX delta time' */
32687 L4_MABX_B.SFunction1_o5_kn = L4_MABX_P.RXdeltatime_Y0_ae;
32688
32689 /* End of SystemInitialize for SubSystem: '<S608>/CAN_TYPE1_RX_M1_C1' */
32690
32691 /* SystemInitialize for Enabled SubSystem: '<S609>/CAN_TYPE1_RX_M1_C2' */
32692 /* SystemInitialize for Outport: '<S613>/EPBPCMInhibitStatusFeedback' */
32693 L4_MABX_B.SFunction1_o1_a1 = L4_MABX_P.EPBPCMInhibitStatusFeedback_Y_k;
32694
32695 /* SystemInitialize for Outport: '<S613>/EPBPCMManualStatusFeedback' */
32696 L4_MABX_B.SFunction1_o2_dg = L4_MABX_P.EPBPCMManualStatusFeedback_Y0_p;
32697
32698 /* SystemInitialize for Outport: '<S613>/RX status' */
32699 L4_MABX_B.SFunction1_o3_oh = L4_MABX_P.RXstatus_Y0_pa;
32700
32701 /* SystemInitialize for Outport: '<S613>/RX time' */
32702 L4_MABX_B.SFunction1_o4_jd = L4_MABX_P.RXtime_Y0_bl;
32703
32704 /* SystemInitialize for Outport: '<S613>/RX delta time' */
32705 L4_MABX_B.SFunction1_o5_mw = L4_MABX_P.RXdeltatime_Y0_ee;
32706
32707 /* End of SystemInitialize for SubSystem: '<S609>/CAN_TYPE1_RX_M1_C2' */
32708
32709 /* SystemInitialize for Enabled SubSystem: '<S610>/CAN_TYPE1_RX_M2_C1' */
32710 /* SystemInitialize for Outport: '<S614>/EPBPCMInhibitStatusFeedback' */
32711 L4_MABX_B.SFunction1_o1_lv = L4_MABX_P.EPBPCMInhibitStatusFeedback_Y_g;
32712
32713 /* SystemInitialize for Outport: '<S614>/EPBPCMManualStatusFeedback' */
32714 L4_MABX_B.SFunction1_o2_f = L4_MABX_P.EPBPCMManualStatusFeedback_Y0_n;
32715
32716 /* SystemInitialize for Outport: '<S614>/RX status' */
32717 L4_MABX_B.SFunction1_o3_atb = L4_MABX_P.RXstatus_Y0_fu;
32718
32719 /* SystemInitialize for Outport: '<S614>/RX time' */
32720 L4_MABX_B.SFunction1_o4_h3 = L4_MABX_P.RXtime_Y0_dc;
32721
32722 /* SystemInitialize for Outport: '<S614>/RX delta time' */
32723 L4_MABX_B.SFunction1_o5_f3f = L4_MABX_P.RXdeltatime_Y0_c;
32724
32725 /* End of SystemInitialize for SubSystem: '<S610>/CAN_TYPE1_RX_M2_C1' */
32726
32727 /* SystemInitialize for Enabled SubSystem: '<S621>/PX2_LaneEdgeLeft' */
32728 /* SystemInitialize for Outport: '<S622>/PX2_LaneEdgeLeftAngle' */
32729 L4_MABX_B.SFunction1_o1_lb = L4_MABX_P.PX2_LaneEdgeLeftAngle_Y0;
32730
32731 /* SystemInitialize for Outport: '<S622>/PX2_LaneEdgeLeftNumPoints' */
32732 L4_MABX_B.SFunction1_o2_om = L4_MABX_P.PX2_LaneEdgeLeftNumPoints_Y0;
32733
32734 /* SystemInitialize for Outport: '<S622>/PX2_LaneEdgeLeftPosition' */
32735 L4_MABX_B.SFunction1_o3_gw = L4_MABX_P.PX2_LaneEdgeLeftPosition_Y0;
32736
32737 /* SystemInitialize for Outport: '<S622>/RX status' */
32738 L4_MABX_B.SFunction1_o4_pa = L4_MABX_P.RXstatus_Y0_o;
32739
32740 /* SystemInitialize for Outport: '<S622>/RX time' */
32741 L4_MABX_B.SFunction1_o5_br = L4_MABX_P.RXtime_Y0_er;
32742
32743 /* SystemInitialize for Outport: '<S622>/RX delta time' */
32744 L4_MABX_B.SFunction1_o6_p3 = L4_MABX_P.RXdeltatime_Y0_av;
32745
32746 /* End of SystemInitialize for SubSystem: '<S621>/PX2_LaneEdgeLeft' */
32747
32748 /* SystemInitialize for Enabled SubSystem: '<S621>/PX2_LaneEdgeRight' */
32749 /* SystemInitialize for Outport: '<S623>/PX2_LaneEdgeRightAngle' */
32750 L4_MABX_B.SFunction1_o1_fq = L4_MABX_P.PX2_LaneEdgeRightAngle_Y0;
32751
32752 /* SystemInitialize for Outport: '<S623>/PX2_LaneEdgeRightNumPoints' */
32753 L4_MABX_B.SFunction1_o2_gp = L4_MABX_P.PX2_LaneEdgeRightNumPoints_Y0;
32754
32755 /* SystemInitialize for Outport: '<S623>/PX2_LaneEdgeRightPosition' */
32756 L4_MABX_B.SFunction1_o3_j = L4_MABX_P.PX2_LaneEdgeRightPosition_Y0;
32757
32758 /* SystemInitialize for Outport: '<S623>/RX status' */
32759 L4_MABX_B.SFunction1_o4_l0 = L4_MABX_P.RXstatus_Y0_fm;
32760
32761 /* SystemInitialize for Outport: '<S623>/RX time' */
32762 L4_MABX_B.SFunction1_o5_d = L4_MABX_P.RXtime_Y0_co;
32763
32764 /* SystemInitialize for Outport: '<S623>/RX delta time' */
32765 L4_MABX_B.SFunction1_o6_o = L4_MABX_P.RXdeltatime_Y0_io;
32766
32767 /* End of SystemInitialize for SubSystem: '<S621>/PX2_LaneEdgeRight' */
32768
32769 /* SystemInitialize for Enabled SubSystem: '<S632>/PX2_MapLaneEgoLeft' */
32770 /* SystemInitialize for Outport: '<S633>/PX2_MapLaneNearPos' */
32771 L4_MABX_B.SFunction1_o1_f = L4_MABX_P.PX2_MapLaneNearPos_Y0;
32772
32773 /* SystemInitialize for Outport: '<S633>/PX2_MapLaneMidPos' */
32774 L4_MABX_B.SFunction1_o2_ia = L4_MABX_P.PX2_MapLaneMidPos_Y0;
32775
32776 /* SystemInitialize for Outport: '<S633>/PX2_MapLaneFarPos' */
32777 L4_MABX_B.SFunction1_o3_eu = L4_MABX_P.PX2_MapLaneFarPos_Y0;
32778
32779 /* SystemInitialize for Outport: '<S633>/PX2_EgoLaneNearPosValid' */
32780 L4_MABX_B.SFunction1_o4_fd = L4_MABX_P.PX2_EgoLaneNearPosValid_Y0;
32781
32782 /* SystemInitialize for Outport: '<S633>/PX2_EgoLaneMidPosValid' */
32783 L4_MABX_B.SFunction1_o5_l = L4_MABX_P.PX2_EgoLaneMidPosValid_Y0;
32784
32785 /* SystemInitialize for Outport: '<S633>/PX2_EgoLaneFarPosValid' */
32786 L4_MABX_B.SFunction1_o6_ls = L4_MABX_P.PX2_EgoLaneFarPosValid_Y0;
32787
32788 /* SystemInitialize for Outport: '<S633>/RX status' */
32789 L4_MABX_B.SFunction1_o7_ah = L4_MABX_P.RXstatus_Y0_bny;
32790
32791 /* SystemInitialize for Outport: '<S633>/RX time' */
32792 L4_MABX_B.SFunction1_o8_fp = L4_MABX_P.RXtime_Y0_ed;
32793
32794 /* SystemInitialize for Outport: '<S633>/RX delta time' */
32795 L4_MABX_B.SFunction1_o9_c = L4_MABX_P.RXdeltatime_Y0_pi;
32796
32797 /* End of SystemInitialize for SubSystem: '<S632>/PX2_MapLaneEgoLeft' */
32798
32799 /* SystemInitialize for Enabled SubSystem: '<S634>/PX2_MapLaneEgoRight' */
32800 /* SystemInitialize for Outport: '<S635>/PX2_MapLaneNearPos' */
32801 L4_MABX_B.SFunction1_o1_d = L4_MABX_P.PX2_MapLaneNearPos_Y0_l;
32802
32803 /* SystemInitialize for Outport: '<S635>/PX2_MapLaneMidPos' */
32804 L4_MABX_B.SFunction1_o2_jz = L4_MABX_P.PX2_MapLaneMidPos_Y0_c;
32805
32806 /* SystemInitialize for Outport: '<S635>/PX2_MapLaneFarPos' */
32807 L4_MABX_B.SFunction1_o3_fv = L4_MABX_P.PX2_MapLaneFarPos_Y0_h;
32808
32809 /* SystemInitialize for Outport: '<S635>/PX2_EgoLaneNearPosValid' */
32810 L4_MABX_B.SFunction1_o4_mx = L4_MABX_P.PX2_EgoLaneNearPosValid_Y0_h;
32811
32812 /* SystemInitialize for Outport: '<S635>/PX2_EgoLaneMidPosValid' */
32813 L4_MABX_B.SFunction1_o5_b = L4_MABX_P.PX2_EgoLaneMidPosValid_Y0_m;
32814
32815 /* SystemInitialize for Outport: '<S635>/PX2_EgoLaneFarPosValid' */
32816 L4_MABX_B.SFunction1_o6_l = L4_MABX_P.PX2_EgoLaneFarPosValid_Y0_c;
32817
32818 /* SystemInitialize for Outport: '<S635>/RX status' */
32819 L4_MABX_B.SFunction1_o7_c0 = L4_MABX_P.RXstatus_Y0_gl;
32820
32821 /* SystemInitialize for Outport: '<S635>/RX time' */
32822 L4_MABX_B.SFunction1_o8_l = L4_MABX_P.RXtime_Y0_g;
32823
32824 /* SystemInitialize for Outport: '<S635>/RX delta time' */
32825 L4_MABX_B.SFunction1_o9_az = L4_MABX_P.RXdeltatime_Y0_cf;
32826
32827 /* End of SystemInitialize for SubSystem: '<S634>/PX2_MapLaneEgoRight' */
32828
32829 /* SystemInitialize for Enabled SubSystem: '<S636>/PX2_EgoLanePos' */
32830 /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneNearPosErr' */
32831 L4_MABX_B.SFunction1_o1_ak = L4_MABX_P.PX2_EgoLaneNearPosErr_Y0;
32832
32833 /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneMidPosErr' */
32834 L4_MABX_B.SFunction1_o2_m = L4_MABX_P.PX2_EgoLaneMidPosErr_Y0;
32835
32836 /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneFarPosErr' */
32837 L4_MABX_B.SFunction1_o3_i = L4_MABX_P.PX2_EgoLaneFarPosErr_Y0;
32838
32839 /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneNearPosValid' */
32840 L4_MABX_B.SFunction1_o4_n = L4_MABX_P.PX2_EgoLaneNearPosValid_Y0_e;
32841
32842 /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneMidPosValid' */
32843 L4_MABX_B.SFunction1_o5_f3 = L4_MABX_P.PX2_EgoLaneMidPosValid_Y0_p;
32844
32845 /* SystemInitialize for Outport: '<S637>/PX2_EgoLaneFarPosValid' */
32846 L4_MABX_B.SFunction1_o6_h = L4_MABX_P.PX2_EgoLaneFarPosValid_Y0_co;
32847
32848 /* SystemInitialize for Outport: '<S637>/RX status' */
32849 L4_MABX_B.SFunction1_o7_a = L4_MABX_P.RXstatus_Y0_lju;
32850
32851 /* SystemInitialize for Outport: '<S637>/RX time' */
32852 L4_MABX_B.SFunction1_o8_d = L4_MABX_P.RXtime_Y0_n0;
32853
32854 /* SystemInitialize for Outport: '<S637>/RX delta time' */
32855 L4_MABX_B.SFunction1_o9_a = L4_MABX_P.RXdeltatime_Y0_ao;
32856
32857 /* End of SystemInitialize for SubSystem: '<S636>/PX2_EgoLanePos' */
32858
32859 /* SystemInitialize for Enabled SubSystem: '<S646>/VEP1' */
32860 /* SystemInitialize for Outport: '<S647>/NetBatteryCurrent' */
32861 L4_MABX_B.SFunction1_o1_ow = L4_MABX_P.NetBatteryCurrent_Y0;
32862
32863 /* SystemInitialize for Outport: '<S647>/AltCurrent' */
32864 L4_MABX_B.SFunction1_o2_jj = L4_MABX_P.AltCurrent_Y0;
32865
32866 /* SystemInitialize for Outport: '<S647>/ChargingSystemPotential' */
32867 L4_MABX_B.SFunction1_o3_at = L4_MABX_P.ChargingSystemPotential_Y0;
32868
32869 /* SystemInitialize for Outport: '<S647>/BatteryPotential_PowerInput1' */
32870 L4_MABX_B.SFunction1_o4_m2 = L4_MABX_P.BatteryPotential_PowerInput1_Y0;
32871
32872 /* SystemInitialize for Outport: '<S647>/KeyswitchBatteryPotential' */
32873 L4_MABX_B.SFunction1_o5 = L4_MABX_P.KeyswitchBatteryPotential_Y0;
32874
32875 /* SystemInitialize for Outport: '<S647>/RX status' */
32876 L4_MABX_B.SFunction1_o6 = L4_MABX_P.RXstatus_Y0_c4;
32877
32878 /* SystemInitialize for Outport: '<S647>/RX time' */
32879 L4_MABX_B.SFunction1_o7 = L4_MABX_P.RXtime_Y0_m;
32880
32881 /* SystemInitialize for Outport: '<S647>/RX delta time' */
32882 L4_MABX_B.SFunction1_o8 = L4_MABX_P.RXdeltatime_Y0_hc;
32883
32884 /* End of SystemInitialize for SubSystem: '<S646>/VEP1' */
32885
32886 /* SystemInitialize for Enabled SubSystem: '<S469>/Decode_TPCM_CTS' */
32887 /* SystemInitialize for Outport: '<S688>/Out' */
32888 L4_MABX_B.SPN2556_ControlByte_d = (uint8_T)L4_MABX_P.Out_Y0_b;
32889 L4_MABX_B.SPN2561_NumberOfPacketsThatCanB = (uint8_T)L4_MABX_P.Out_Y0_b;
32890 L4_MABX_B.SPN2562_NextPacketNumberToBeSen = (uint8_T)L4_MABX_P.Out_Y0_b;
32891 L4_MABX_B.DataType_il = (uint32_T)L4_MABX_P.Out_Y0_b;
32892
32893 /* End of SystemInitialize for SubSystem: '<S469>/Decode_TPCM_CTS' */
32894
32895 /* SystemInitialize for Enabled SubSystem: '<S469>/Decode_TPCM_ConnectionAbort' */
32896 /* SystemInitialize for Outport: '<S689>/Out' */
32897 L4_MABX_B.SPN2556_ControlByte_n = (uint8_T)L4_MABX_P.Out_Y0_m;
32898 L4_MABX_B.SPN2570_ConnectionAbortReason = (uint8_T)L4_MABX_P.Out_Y0_m;
32899 L4_MABX_B.DataType_hm = (uint32_T)L4_MABX_P.Out_Y0_m;
32900
32901 /* End of SystemInitialize for SubSystem: '<S469>/Decode_TPCM_ConnectionAbort' */
32902
32903 /* SystemInitialize for Enabled SubSystem: '<S469>/Decode_TPCM_EndOfMessageAck' */
32904 /* SystemInitialize for Outport: '<S690>/Out' */
32905 L4_MABX_B.SPN2556_ControlByte_o = (uint8_T)L4_MABX_P.Out_Y0_i;
32906 L4_MABX_B.DataType_cp = (uint16_T)L4_MABX_P.Out_Y0_i;
32907 L4_MABX_B.SPN2565_TotalNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_i;
32908 L4_MABX_B.DataType_ns = (uint32_T)L4_MABX_P.Out_Y0_i;
32909
32910 /* End of SystemInitialize for SubSystem: '<S469>/Decode_TPCM_EndOfMessageAck' */
32911
32912 /* SystemInitialize for Enabled SubSystem: '<S469>/Decode_TPCM_RTS' */
32913 /* SystemInitialize for Outport: '<S691>/Out' */
32914 L4_MABX_B.SPN2556_ControlByte = (uint8_T)L4_MABX_P.Out_Y0_bf;
32915 L4_MABX_B.DataType_cn = (uint16_T)L4_MABX_P.Out_Y0_bf;
32916 L4_MABX_B.SPN2558_TotalNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_bf;
32917 L4_MABX_B.SPN2559_MaximumNumberOfPackets = (uint8_T)L4_MABX_P.Out_Y0_bf;
32918 L4_MABX_B.DataType_iz = (uint32_T)L4_MABX_P.Out_Y0_bf;
32919
32920 /* End of SystemInitialize for SubSystem: '<S469>/Decode_TPCM_RTS' */
32921
32922 /* SystemInitialize for Enabled SubSystem: '<S582>/CAN_TYPE1_RX_M1_C1' */
32923 /* SystemInitialize for Outport: '<S586>/byte1' */
32924 L4_MABX_B.SFunction1_o1_ajb = L4_MABX_P.byte1_Y0_c;
32925
32926 /* SystemInitialize for Outport: '<S586>/byte2' */
32927 L4_MABX_B.SFunction1_o2_ej = L4_MABX_P.byte2_Y0_p;
32928
32929 /* SystemInitialize for Outport: '<S586>/byte3' */
32930 L4_MABX_B.SFunction1_o3_as = L4_MABX_P.byte3_Y0_j;
32931
32932 /* SystemInitialize for Outport: '<S586>/byte4' */
32933 L4_MABX_B.SFunction1_o4_it = L4_MABX_P.byte4_Y0_j;
32934
32935 /* SystemInitialize for Outport: '<S586>/byte5' */
32936 L4_MABX_B.SFunction1_o5_a = L4_MABX_P.byte5_Y0_e;
32937
32938 /* SystemInitialize for Outport: '<S586>/byte6' */
32939 L4_MABX_B.SFunction1_o6_gn = L4_MABX_P.byte6_Y0_k;
32940
32941 /* SystemInitialize for Outport: '<S586>/byte7' */
32942 L4_MABX_B.SFunction1_o7_ad = L4_MABX_P.byte7_Y0_m;
32943
32944 /* SystemInitialize for Outport: '<S586>/byte8' */
32945 L4_MABX_B.SFunction1_o8_pl = L4_MABX_P.byte8_Y0_e;
32946
32947 /* SystemInitialize for Outport: '<S586>/RX status' */
32948 L4_MABX_B.SFunction1_o9_le = L4_MABX_P.RXstatus_Y0_l5;
32949
32950 /* SystemInitialize for Outport: '<S586>/RX time' */
32951 L4_MABX_B.SFunction1_o10_m = L4_MABX_P.RXtime_Y0_dt;
32952
32953 /* SystemInitialize for Outport: '<S586>/RX delta time' */
32954 L4_MABX_B.SFunction1_o11_h = L4_MABX_P.RXdeltatime_Y0_hv;
32955
32956 /* End of SystemInitialize for SubSystem: '<S582>/CAN_TYPE1_RX_M1_C1' */
32957
32958 /* SystemInitialize for Enabled SubSystem: '<S583>/CAN_TYPE1_RX_M1_C2' */
32959 /* SystemInitialize for Outport: '<S587>/byte1' */
32960 L4_MABX_B.SFunction1_o1_koq = L4_MABX_P.byte1_Y0_n;
32961
32962 /* SystemInitialize for Outport: '<S587>/byte2' */
32963 L4_MABX_B.SFunction1_o2_e = L4_MABX_P.byte2_Y0_i;
32964
32965 /* SystemInitialize for Outport: '<S587>/byte3' */
32966 L4_MABX_B.SFunction1_o3_ab = L4_MABX_P.byte3_Y0_n;
32967
32968 /* SystemInitialize for Outport: '<S587>/byte4' */
32969 L4_MABX_B.SFunction1_o4_ej = L4_MABX_P.byte4_Y0_p;
32970
32971 /* SystemInitialize for Outport: '<S587>/byte5' */
32972 L4_MABX_B.SFunction1_o5_n = L4_MABX_P.byte5_Y0_f;
32973
32974 /* SystemInitialize for Outport: '<S587>/byte6' */
32975 L4_MABX_B.SFunction1_o6_nf = L4_MABX_P.byte6_Y0_o;
32976
32977 /* SystemInitialize for Outport: '<S587>/byte7' */
32978 L4_MABX_B.SFunction1_o7_m = L4_MABX_P.byte7_Y0_o;
32979
32980 /* SystemInitialize for Outport: '<S587>/byte8' */
32981 L4_MABX_B.SFunction1_o8_o = L4_MABX_P.byte8_Y0_o;
32982
32983 /* SystemInitialize for Outport: '<S587>/RX status' */
32984 L4_MABX_B.SFunction1_o9_mi = L4_MABX_P.RXstatus_Y0_bn;
32985
32986 /* SystemInitialize for Outport: '<S587>/RX time' */
32987 L4_MABX_B.SFunction1_o10_g = L4_MABX_P.RXtime_Y0_dg;
32988
32989 /* SystemInitialize for Outport: '<S587>/RX delta time' */
32990 L4_MABX_B.SFunction1_o11_f = L4_MABX_P.RXdeltatime_Y0_ap;
32991
32992 /* End of SystemInitialize for SubSystem: '<S583>/CAN_TYPE1_RX_M1_C2' */
32993
32994 /* SystemInitialize for Enabled SubSystem: '<S584>/CAN_TYPE1_RX_M3_C2' */
32995 /* SystemInitialize for Outport: '<S588>/byte1' */
32996 L4_MABX_B.SFunction1_o1_fo = L4_MABX_P.byte1_Y0_lo;
32997
32998 /* SystemInitialize for Outport: '<S588>/byte2' */
32999 L4_MABX_B.SFunction1_o2_mv = L4_MABX_P.byte2_Y0_g;
33000
33001 /* SystemInitialize for Outport: '<S588>/byte3' */
33002 L4_MABX_B.SFunction1_o3_j5 = L4_MABX_P.byte3_Y0_m;
33003
33004 /* SystemInitialize for Outport: '<S588>/byte4' */
33005 L4_MABX_B.SFunction1_o4_n0 = L4_MABX_P.byte4_Y0_i;
33006
33007 /* SystemInitialize for Outport: '<S588>/byte5' */
33008 L4_MABX_B.SFunction1_o5_ov = L4_MABX_P.byte5_Y0_f0;
33009
33010 /* SystemInitialize for Outport: '<S588>/byte6' */
33011 L4_MABX_B.SFunction1_o6_g = L4_MABX_P.byte6_Y0_h;
33012
33013 /* SystemInitialize for Outport: '<S588>/byte7' */
33014 L4_MABX_B.SFunction1_o7_ou = L4_MABX_P.byte7_Y0_i;
33015
33016 /* SystemInitialize for Outport: '<S588>/byte8' */
33017 L4_MABX_B.SFunction1_o8_m0 = L4_MABX_P.byte8_Y0_c;
33018
33019 /* SystemInitialize for Outport: '<S588>/RX status' */
33020 L4_MABX_B.SFunction1_o9_l = L4_MABX_P.RXstatus_Y0_pu;
33021
33022 /* SystemInitialize for Outport: '<S588>/RX time' */
33023 L4_MABX_B.SFunction1_o10_c = L4_MABX_P.RXtime_Y0_e;
33024
33025 /* SystemInitialize for Outport: '<S588>/RX delta time' */
33026 L4_MABX_B.SFunction1_o11_l = L4_MABX_P.RXdeltatime_Y0_ii;
33027
33028 /* End of SystemInitialize for SubSystem: '<S584>/CAN_TYPE1_RX_M3_C2' */
33029
33030 /* SystemInitialize for Enabled SubSystem: '<S595>/CAN_TYPE1_RX_M1_C1' */
33031 /* SystemInitialize for Outport: '<S599>/byte1' */
33032 L4_MABX_B.SFunction1_o1_ld = L4_MABX_P.byte1_Y0_g;
33033
33034 /* SystemInitialize for Outport: '<S599>/byte2' */
33035 L4_MABX_B.SFunction1_o2_g4 = L4_MABX_P.byte2_Y0_d;
33036
33037 /* SystemInitialize for Outport: '<S599>/byte3' */
33038 L4_MABX_B.SFunction1_o3_h1 = L4_MABX_P.byte3_Y0_jd;
33039
33040 /* SystemInitialize for Outport: '<S599>/byte4' */
33041 L4_MABX_B.SFunction1_o4_pp = L4_MABX_P.byte4_Y0_f;
33042
33043 /* SystemInitialize for Outport: '<S599>/byte5' */
33044 L4_MABX_B.SFunction1_o5_hd = L4_MABX_P.byte5_Y0_o;
33045
33046 /* SystemInitialize for Outport: '<S599>/byte6' */
33047 L4_MABX_B.SFunction1_o6_f4 = L4_MABX_P.byte6_Y0_i;
33048
33049 /* SystemInitialize for Outport: '<S599>/byte7' */
33050 L4_MABX_B.SFunction1_o7_kv = L4_MABX_P.byte7_Y0_j;
33051
33052 /* SystemInitialize for Outport: '<S599>/byte8' */
33053 L4_MABX_B.SFunction1_o8_m = L4_MABX_P.byte8_Y0_h;
33054
33055 /* SystemInitialize for Outport: '<S599>/RX status' */
33056 L4_MABX_B.SFunction1_o9_ii = L4_MABX_P.RXstatus_Y0_cl;
33057
33058 /* SystemInitialize for Outport: '<S599>/RX time' */
33059 L4_MABX_B.SFunction1_o10_d = L4_MABX_P.RXtime_Y0_bq;
33060
33061 /* SystemInitialize for Outport: '<S599>/RX delta time' */
33062 L4_MABX_B.SFunction1_o11_m = L4_MABX_P.RXdeltatime_Y0_b;
33063
33064 /* End of SystemInitialize for SubSystem: '<S595>/CAN_TYPE1_RX_M1_C1' */
33065
33066 /* SystemInitialize for Enabled SubSystem: '<S596>/CAN_TYPE1_RX_M1_C2' */
33067 /* SystemInitialize for Outport: '<S600>/byte1' */
33068 L4_MABX_B.SFunction1_o1_dr = L4_MABX_P.byte1_Y0_li;
33069
33070 /* SystemInitialize for Outport: '<S600>/byte2' */
33071 L4_MABX_B.SFunction1_o2_gv = L4_MABX_P.byte2_Y0_l;
33072
33073 /* SystemInitialize for Outport: '<S600>/byte3' */
33074 L4_MABX_B.SFunction1_o3_p0 = L4_MABX_P.byte3_Y0_o;
33075
33076 /* SystemInitialize for Outport: '<S600>/byte4' */
33077 L4_MABX_B.SFunction1_o4_hs = L4_MABX_P.byte4_Y0_d;
33078
33079 /* SystemInitialize for Outport: '<S600>/byte5' */
33080 L4_MABX_B.SFunction1_o5_e = L4_MABX_P.byte5_Y0_g;
33081
33082 /* SystemInitialize for Outport: '<S600>/byte6' */
33083 L4_MABX_B.SFunction1_o6_ix = L4_MABX_P.byte6_Y0_g;
33084
33085 /* SystemInitialize for Outport: '<S600>/byte7' */
33086 L4_MABX_B.SFunction1_o7_nn = L4_MABX_P.byte7_Y0_ol;
33087
33088 /* SystemInitialize for Outport: '<S600>/byte8' */
33089 L4_MABX_B.SFunction1_o8_p = L4_MABX_P.byte8_Y0_a;
33090
33091 /* SystemInitialize for Outport: '<S600>/RX status' */
33092 L4_MABX_B.SFunction1_o9_h = L4_MABX_P.RXstatus_Y0_dy;
33093
33094 /* SystemInitialize for Outport: '<S600>/RX time' */
33095 L4_MABX_B.SFunction1_o10_e = L4_MABX_P.RXtime_Y0_ap;
33096
33097 /* SystemInitialize for Outport: '<S600>/RX delta time' */
33098 L4_MABX_B.SFunction1_o11_c = L4_MABX_P.RXdeltatime_Y0_m;
33099
33100 /* End of SystemInitialize for SubSystem: '<S596>/CAN_TYPE1_RX_M1_C2' */
33101
33102 /* SystemInitialize for Enabled SubSystem: '<S597>/CAN_TYPE1_RX_M3_C2' */
33103 /* SystemInitialize for Outport: '<S601>/byte1' */
33104 L4_MABX_B.SFunction1_o1_dp = L4_MABX_P.byte1_Y0_j;
33105
33106 /* SystemInitialize for Outport: '<S601>/byte2' */
33107 L4_MABX_B.SFunction1_o2_dc = L4_MABX_P.byte2_Y0_h;
33108
33109 /* SystemInitialize for Outport: '<S601>/byte3' */
33110 L4_MABX_B.SFunction1_o3_k = L4_MABX_P.byte3_Y0_oy;
33111
33112 /* SystemInitialize for Outport: '<S601>/byte4' */
33113 L4_MABX_B.SFunction1_o4_ah = L4_MABX_P.byte4_Y0_f5;
33114
33115 /* SystemInitialize for Outport: '<S601>/byte5' */
33116 L4_MABX_B.SFunction1_o5_dl = L4_MABX_P.byte5_Y0_i;
33117
33118 /* SystemInitialize for Outport: '<S601>/byte6' */
33119 L4_MABX_B.SFunction1_o6_o2 = L4_MABX_P.byte6_Y0_n;
33120
33121 /* SystemInitialize for Outport: '<S601>/byte7' */
33122 L4_MABX_B.SFunction1_o7_n = L4_MABX_P.byte7_Y0_h;
33123
33124 /* SystemInitialize for Outport: '<S601>/byte8' */
33125 L4_MABX_B.SFunction1_o8_dr = L4_MABX_P.byte8_Y0_ec;
33126
33127 /* SystemInitialize for Outport: '<S601>/RX status' */
33128 L4_MABX_B.SFunction1_o9_ch = L4_MABX_P.RXstatus_Y0_ms;
33129
33130 /* SystemInitialize for Outport: '<S601>/RX time' */
33131 L4_MABX_B.SFunction1_o10_p = L4_MABX_P.RXtime_Y0_oj;
33132
33133 /* SystemInitialize for Outport: '<S601>/RX delta time' */
33134 L4_MABX_B.SFunction1_o11_a = L4_MABX_P.RXdeltatime_Y0_hi;
33135
33136 /* End of SystemInitialize for SubSystem: '<S597>/CAN_TYPE1_RX_M3_C2' */
33137
33138 /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */
33139 /* InitializeConditions for UnitDelay: '<S30>/Unit_Delay' */
33140 L4_MABX_DW.Unit_Delay_DSTATE_f1 = L4_MABX_P.Unit_Delay_InitialCondition_e3;
33141
33142 /* InitializeConditions for UnitDelay: '<S31>/Unit Delay' */
33143 L4_MABX_DW.UnitDelay_DSTATE_j1 = L4_MABX_P.UnitDelay_InitialCondition_n;
33144
33145 /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_1' */
33146
33147 /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */
33148 /* InitializeConditions for UnitDelay: '<S54>/Unit_Delay' */
33149 L4_MABX_DW.Unit_Delay_DSTATE_i5 = L4_MABX_P.Unit_Delay_InitialCondition_o;
33150
33151 /* InitializeConditions for UnitDelay: '<S55>/Unit Delay' */
33152 L4_MABX_DW.UnitDelay_DSTATE_p = L4_MABX_P.UnitDelay_InitialCondition_pg;
33153
33154 /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_5' */
33155
33156 /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */
33157 /* InitializeConditions for UnitDelay: '<S60>/Unit_Delay' */
33158 L4_MABX_DW.Unit_Delay_DSTATE_l5 = L4_MABX_P.Unit_Delay_InitialCondition_le;
33159
33160 /* InitializeConditions for UnitDelay: '<S61>/Unit Delay' */
33161 L4_MABX_DW.UnitDelay_DSTATE_dr = L4_MABX_P.UnitDelay_InitialCondition_i;
33162
33163 /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_6' */
33164
33165 /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */
33166 /* InitializeConditions for UnitDelay: '<S42>/Unit_Delay' */
33167 L4_MABX_DW.Unit_Delay_DSTATE_h41 = L4_MABX_P.Unit_Delay_InitialCondition_m;
33168
33169 /* InitializeConditions for UnitDelay: '<S43>/Unit Delay' */
33170 L4_MABX_DW.UnitDelay_DSTATE_dr4 = L4_MABX_P.UnitDelay_InitialCondition_hk;
33171
33172 /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_3' */
33173
33174 /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */
33175 /* InitializeConditions for UnitDelay: '<S48>/Unit_Delay' */
33176 L4_MABX_DW.Unit_Delay_DSTATE_mq = L4_MABX_P.Unit_Delay_InitialCondition_bo;
33177
33178 /* InitializeConditions for UnitDelay: '<S49>/Unit Delay' */
33179 L4_MABX_DW.UnitDelay_DSTATE_hi = L4_MABX_P.UnitDelay_InitialCondition_l;
33180
33181 /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_4' */
33182
33183 /* SystemInitialize for Enabled SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */
33184 /* InitializeConditions for UnitDelay: '<S36>/Unit_Delay' */
33185 L4_MABX_DW.Unit_Delay_DSTATE_je = L4_MABX_P.Unit_Delay_InitialCondition_in;
33186
33187 /* InitializeConditions for UnitDelay: '<S37>/Unit Delay' */
33188 L4_MABX_DW.UnitDelay_DSTATE_b = L4_MABX_P.UnitDelay_InitialCondition_m2;
33189
33190 /* End of SystemInitialize for SubSystem: '<S1>/BUS_OFF_RECOVERY_2' */
33191 }
33192}
33193
33194/* Model terminate function */
33195void L4_MABX_terminate(void)
33196{
33197 /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_1000ms' */
33198
33199 /* Terminate for Enabled SubSystem: '<S869>/AIR1' */
33200
33201 /* Terminate for S-Function (rti_commonblock): '<S870>/S-Function1' */
33202
33203 /* dSPACE RTICAN TX Message Block: "AIR1" Id:419343921 */
33204 {
33205 /* ... Set the message into sleep mode */
33206 while ((rtican_type1_tq_error[1][3] = can_tp1_msg_sleep
33207 (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEAE31])) ==
33208 DSMCOM_BUFFER_OVERFLOW) ;
33209 }
33210
33211 /* End of Terminate for SubSystem: '<S869>/AIR1' */
33212
33213 /* Terminate for Enabled SubSystem: '<S877>/AMB' */
33214
33215 /* Terminate for S-Function (rti_commonblock): '<S878>/S-Function1' */
33216
33217 /* dSPACE RTICAN TX Message Block: "AMB" Id:419362048 */
33218 {
33219 /* ... Set the message into sleep mode */
33220 while ((rtican_type1_tq_error[1][4] = can_tp1_msg_sleep
33221 (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18FEF500])) ==
33222 DSMCOM_BUFFER_OVERFLOW) ;
33223 }
33224
33225 /* End of Terminate for SubSystem: '<S877>/AMB' */
33226
33227 /* End of Terminate for SubSystem: '<S849>/CAN_TX_1000ms' */
33228
33229 /* Terminate for S-Function (dsa_tcpip_setup_sfcn): '<S399>/dsa_tcpip_setup' */
33230 /* Level2 S-Function Block: '<S399>/dsa_tcpip_setup' (dsa_tcpip_setup_sfcn) */
33231 {
33232 SimStruct *rts = L4_MABX_M->childSfunctions[3];
33233 sfcnTerminate(rts);
33234 }
33235
33236 /* Terminate for S-Function (dsa_tcpip_udp_sfcn): '<S400>/TCPIP_Com' */
33237 /* Level2 S-Function Block: '<S400>/TCPIP_Com' (dsa_tcpip_udp_sfcn) */
33238 {
33239 SimStruct *rts = L4_MABX_M->childSfunctions[4];
33240 sfcnTerminate(rts);
33241 }
33242
33243 /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_100ms' */
33244
33245 /* Terminate for Enabled SubSystem: '<S908>/PropB_XPR_FC' */
33246
33247 /* Terminate for S-Function (rti_commonblock): '<S910>/S-Function1' */
33248
33249 /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */
33250 {
33251 /* ... Set the message into sleep mode */
33252 while ((rtican_type1_tq_error[0][4] = can_tp1_msg_sleep
33253 (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18FF04FC])) ==
33254 DSMCOM_BUFFER_OVERFLOW) ;
33255 }
33256
33257 /* End of Terminate for SubSystem: '<S908>/PropB_XPR_FC' */
33258
33259 /* Terminate for Enabled SubSystem: '<S909>/PropB_XPR_FC' */
33260
33261 /* Terminate for S-Function (rti_commonblock): '<S911>/S-Function1' */
33262
33263 /* dSPACE RTICAN TX Message Block: "PropB_XPR_FC" Id:419366140 */
33264 {
33265 /* ... Set the message into sleep mode */
33266 while ((rtican_type1_tq_error[1][4] = can_tp1_msg_sleep
33267 (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FF04FC])) ==
33268 DSMCOM_BUFFER_OVERFLOW) ;
33269 }
33270
33271 /* End of Terminate for SubSystem: '<S909>/PropB_XPR_FC' */
33272
33273 /* Terminate for Enabled SubSystem: '<S938>/Std_PosRapidUpdate_01' */
33274
33275 /* Terminate for S-Function (rti_commonblock): '<S939>/S-Function1' */
33276
33277 /* dSPACE RTICAN TX Message Block: "Std_PosRapidUpdate_01" Id:3 */
33278 {
33279 /* ... Set the message into sleep mode */
33280 while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep
33281 (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X3])) ==
33282 DSMCOM_BUFFER_OVERFLOW) ;
33283 }
33284
33285 /* End of Terminate for SubSystem: '<S938>/Std_PosRapidUpdate_01' */
33286
33287 /* Terminate for Enabled SubSystem: '<S888>/CCVS1_00' */
33288
33289 /* Terminate for S-Function (rti_commonblock): '<S890>/S-Function1' */
33290
33291 /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:419361024 */
33292 {
33293 /* ... Set the message into sleep mode */
33294 while ((rtican_type1_tq_error[0][3] = can_tp1_msg_sleep
33295 (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FEF100])) ==
33296 DSMCOM_BUFFER_OVERFLOW) ;
33297 }
33298
33299 /* End of Terminate for SubSystem: '<S888>/CCVS1_00' */
33300
33301 /* Terminate for Enabled SubSystem: '<S889>/CCVS1_00' */
33302
33303 /* Terminate for S-Function (rti_commonblock): '<S891>/S-Function1' */
33304
33305 /* dSPACE RTICAN TX Message Block: "CCVS1_00" Id:218034432 */
33306 {
33307 /* ... Set the message into sleep mode */
33308 while ((rtican_type1_tq_error[2][3] = can_tp1_msg_sleep
33309 (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0XCFEF100])) ==
33310 DSMCOM_BUFFER_OVERFLOW) ;
33311 }
33312
33313 /* End of Terminate for SubSystem: '<S889>/CCVS1_00' */
33314
33315 /* Terminate for Enabled SubSystem: '<S892>/PropB_REAX_5_E4' */
33316
33317 /* Terminate for S-Function (rti_commonblock): '<S894>/S-Function1' incorporates:
33318 * Constant: '<S892>/Constant'
33319 * Constant: '<S892>/Constant1'
33320 */
33321
33322 /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */
33323 {
33324 /* ... Set the message into sleep mode */
33325 while ((rtican_type1_tq_error[0][5] = can_tp1_msg_sleep
33326 (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFFAE4])) ==
33327 DSMCOM_BUFFER_OVERFLOW) ;
33328 }
33329
33330 /* End of Terminate for SubSystem: '<S892>/PropB_REAX_5_E4' */
33331
33332 /* Terminate for Enabled SubSystem: '<S893>/PropB_REAX_5_E4' */
33333
33334 /* Terminate for S-Function (rti_commonblock): '<S895>/S-Function1' incorporates:
33335 * Constant: '<S893>/Constant'
33336 * Constant: '<S893>/Constant1'
33337 */
33338
33339 /* dSPACE RTICAN TX Message Block: "PropB_REAX_5_E4" Id:419429092 */
33340 {
33341 /* ... Set the message into sleep mode */
33342 while ((rtican_type1_tq_error[2][4] = can_tp1_msg_sleep
33343 (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFFAE4])) ==
33344 DSMCOM_BUFFER_OVERFLOW) ;
33345 }
33346
33347 /* End of Terminate for SubSystem: '<S893>/PropB_REAX_5_E4' */
33348
33349 /* Terminate for Enabled SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' */
33350
33351 /* Terminate for S-Function (rti_commonblock): '<S913>/S-Function1' incorporates:
33352 * Constant: '<S912>/Constant'
33353 * Constant: '<S912>/Constant1'
33354 */
33355
33356 /* dSPACE RTICAN TX Message Block: "Std_COGSOGRapidUpdate_01" Id:7 */
33357 {
33358 /* ... Set the message into sleep mode */
33359 while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep
33360 (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X7])) ==
33361 DSMCOM_BUFFER_OVERFLOW) ;
33362 }
33363
33364 /* End of Terminate for SubSystem: '<S912>/Std_COGSOGRapidUpdate_01' */
33365
33366 /* Terminate for Enabled SubSystem: '<S914>/EBC1_TX' */
33367
33368 /* Terminate for S-Function (rti_commonblock): '<S915>/S-Function1' */
33369
33370 /* dSPACE RTICAN TX Message Block: "EBC1_TX" Id:418382219 */
33371 {
33372 /* ... Set the message into sleep mode */
33373 while ((rtican_type1_tq_error[0][2] = can_tp1_msg_sleep
33374 (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18F0018B])) ==
33375 DSMCOM_BUFFER_OVERFLOW) ;
33376 }
33377
33378 /* End of Terminate for SubSystem: '<S914>/EBC1_TX' */
33379
33380 /* End of Terminate for SubSystem: '<S849>/CAN_TX_100ms' */
33381
33382 /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_10ms' */
33383
33384 /* Terminate for Enabled SubSystem: '<S951>/ACCS' */
33385
33386 /* Terminate for S-Function (rti_commonblock): '<S952>/S-Function1' */
33387
33388 /* dSPACE RTICAN TX Message Block: "ACCS" Id:418393572 */
33389 {
33390 /* ... Set the message into sleep mode */
33391 while ((rtican_type1_tq_error[1][3] = can_tp1_msg_sleep
33392 (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0X18F02DE4])) ==
33393 DSMCOM_BUFFER_OVERFLOW) ;
33394 }
33395
33396 /* End of Terminate for SubSystem: '<S951>/ACCS' */
33397
33398 /* Terminate for Enabled SubSystem: '<S959>/EEC1_00' */
33399
33400 /* Terminate for S-Function (rti_commonblock): '<S961>/S-Function1' */
33401
33402 /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */
33403 {
33404 /* ... Set the message into sleep mode */
33405 while ((rtican_type1_tq_error[1][1] = can_tp1_msg_sleep
33406 (can_type1_msg_M2[CANTP1_M2_C2_TX_XTD_0XCF00400])) ==
33407 DSMCOM_BUFFER_OVERFLOW) ;
33408 }
33409
33410 /* End of Terminate for SubSystem: '<S959>/EEC1_00' */
33411
33412 /* Terminate for Enabled SubSystem: '<S960>/EEC1_00' */
33413
33414 /* Terminate for S-Function (rti_commonblock): '<S962>/S-Function1' */
33415
33416 /* dSPACE RTICAN TX Message Block: "EEC1_00" Id:217056256 */
33417 {
33418 /* ... Set the message into sleep mode */
33419 while ((rtican_type1_tq_error[2][3] = can_tp1_msg_sleep
33420 (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0XCF00400])) ==
33421 DSMCOM_BUFFER_OVERFLOW) ;
33422 }
33423
33424 /* End of Terminate for SubSystem: '<S960>/EEC1_00' */
33425
33426 /* Terminate for Enabled SubSystem: '<S963>/PropB_REAX_1_E4' */
33427
33428 /* Terminate for S-Function (rti_commonblock): '<S965>/S-Function1' incorporates:
33429 * Constant: '<S963>/Constant'
33430 * Constant: '<S963>/Constant1'
33431 */
33432
33433 /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */
33434 {
33435 /* ... Set the message into sleep mode */
33436 while ((rtican_type1_tq_error[0][4] = can_tp1_msg_sleep
33437 (can_type1_msg_M1[CANTP1_M1_C2_TX_XTD_0X18FFEFE4])) ==
33438 DSMCOM_BUFFER_OVERFLOW) ;
33439 }
33440
33441 /* End of Terminate for SubSystem: '<S963>/PropB_REAX_1_E4' */
33442
33443 /* Terminate for Enabled SubSystem: '<S964>/PropB_REAX_1_E4' */
33444
33445 /* Terminate for S-Function (rti_commonblock): '<S966>/S-Function1' incorporates:
33446 * Constant: '<S964>/Constant'
33447 * Constant: '<S964>/Constant1'
33448 */
33449
33450 /* dSPACE RTICAN TX Message Block: "PropB_REAX_1_E4" Id:419426276 */
33451 {
33452 /* ... Set the message into sleep mode */
33453 while ((rtican_type1_tq_error[2][4] = can_tp1_msg_sleep
33454 (can_type1_msg_M3[CANTP1_M3_C2_TX_XTD_0X18FFEFE4])) ==
33455 DSMCOM_BUFFER_OVERFLOW) ;
33456 }
33457
33458 /* End of Terminate for SubSystem: '<S964>/PropB_REAX_1_E4' */
33459
33460 /* Terminate for Enabled SubSystem: '<S973>/VDC2_0B' */
33461
33462 /* Terminate for S-Function (rti_commonblock): '<S974>/S-Function1' */
33463
33464 /* dSPACE RTICAN TX Message Block: "VDC2_0B" Id:418384139 */
33465 {
33466 /* ... Set the message into sleep mode */
33467 while ((rtican_type1_tq_error[2][4] = can_tp1_msg_sleep
33468 (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18F0090B])) ==
33469 DSMCOM_BUFFER_OVERFLOW) ;
33470 }
33471
33472 /* End of Terminate for SubSystem: '<S973>/VDC2_0B' */
33473
33474 /* End of Terminate for SubSystem: '<S849>/CAN_TX_10ms' */
33475
33476 /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_20ms' */
33477
33478 /* Terminate for Enabled SubSystem: '<S1018>/PropB_XBR_B3' */
33479
33480 /* Terminate for S-Function (rti_commonblock): '<S1019>/S-Function1' */
33481
33482 /* dSPACE RTICAN TX Message Block: "PropB_XBR_B3" Id:218038707 */
33483 {
33484 /* ... Set the message into sleep mode */
33485 while ((rtican_type1_tq_error[1][2] = can_tp1_msg_sleep
33486 (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF01B3])) ==
33487 DSMCOM_BUFFER_OVERFLOW) ;
33488 }
33489
33490 /* End of Terminate for SubSystem: '<S1018>/PropB_XBR_B3' */
33491
33492 /* Terminate for Enabled SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' */
33493
33494 /* Terminate for S-Function (rti_commonblock): '<S1021>/S-Function1' */
33495
33496 /* dSPACE RTICAN TX Message Block: "PropB_Bendix_2C2_XPR" Id:218060389 */
33497 {
33498 /* ... Set the message into sleep mode */
33499 while ((rtican_type1_tq_error[1][2] = can_tp1_msg_sleep
33500 (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0XCFF5665])) ==
33501 DSMCOM_BUFFER_OVERFLOW) ;
33502 }
33503
33504 /* End of Terminate for SubSystem: '<S1020>/PropB_Bendix_2C2_XPR' */
33505
33506 /* Terminate for Enabled SubSystem: '<S1028>/Std_OdometryData' */
33507
33508 /* Terminate for S-Function (rti_commonblock): '<S1029>/S-Function1' */
33509
33510 /* dSPACE RTICAN TX Message Block: "Std_OdometryData" Id:10 */
33511 {
33512 /* ... Set the message into sleep mode */
33513 while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep
33514 (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0XA])) ==
33515 DSMCOM_BUFFER_OVERFLOW) ;
33516 }
33517
33518 /* End of Terminate for SubSystem: '<S1028>/Std_OdometryData' */
33519
33520 /* End of Terminate for SubSystem: '<S849>/CAN_TX_20ms' */
33521
33522 /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_5000ms' */
33523
33524 /* Terminate for Enabled SubSystem: '<S1043>/RQST_13_E4' */
33525
33526 /* Terminate for S-Function (rti_commonblock): '<S1045>/S-Function1' */
33527
33528 /* dSPACE RTICAN TX Message Block: "RQST_13_E4" Id:417993700 */
33529 {
33530 /* ... Set the message into sleep mode */
33531 while ((rtican_type1_tq_error[2][3] = can_tp1_msg_sleep
33532 (can_type1_msg_M3[CANTP1_M3_C1_TX_XTD_0X18EA13E4])) ==
33533 DSMCOM_BUFFER_OVERFLOW) ;
33534 }
33535
33536 /* End of Terminate for SubSystem: '<S1043>/RQST_13_E4' */
33537
33538 /* End of Terminate for SubSystem: '<S849>/CAN_TX_5000ms' */
33539
33540 /* Terminate for Atomic SubSystem: '<S849>/CAN_TX_50ms' */
33541
33542 /* Terminate for Enabled SubSystem: '<S1054>/CCVS1_E3' */
33543
33544 /* Terminate for S-Function (rti_commonblock): '<S1056>/S-Function1' */
33545
33546 /* dSPACE RTICAN TX Message Block: "CCVS1_E3" Id:419361251 */
33547 {
33548 /* ... Set the message into sleep mode */
33549 while ((rtican_type1_tq_error[1][3] = can_tp1_msg_sleep
33550 (can_type1_msg_M2[CANTP1_M2_C1_TX_XTD_0X18FEF1E3])) ==
33551 DSMCOM_BUFFER_OVERFLOW) ;
33552 }
33553
33554 /* End of Terminate for SubSystem: '<S1054>/CCVS1_E3' */
33555
33556 /* Terminate for Enabled SubSystem: '<S1055>/TC1_03_05' */
33557
33558 /* Terminate for S-Function (rti_commonblock): '<S1057>/S-Function1' */
33559
33560 /* dSPACE RTICAN TX Message Block: "TC1_03_05" Id:201392901 */
33561 {
33562 /* ... Set the message into sleep mode */
33563 while ((rtican_type1_tq_error[0][0] = can_tp1_msg_sleep
33564 (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0XC010305])) ==
33565 DSMCOM_BUFFER_OVERFLOW) ;
33566 }
33567
33568 /* End of Terminate for SubSystem: '<S1055>/TC1_03_05' */
33569
33570 /* End of Terminate for SubSystem: '<S849>/CAN_TX_50ms' */
33571
33572 /* Terminate for Enabled SubSystem: '<S1067>/Std_SystemTime_01' */
33573
33574 /* Terminate for S-Function (rti_commonblock): '<S1069>/S-Function1' incorporates:
33575 * Constant: '<S1067>/Constant'
33576 * Constant: '<S1067>/Constant1'
33577 */
33578
33579 /* dSPACE RTICAN TX Message Block: "Std_SystemTime_01" Id:5 */
33580 {
33581 /* ... Set the message into sleep mode */
33582 while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep
33583 (can_type1_msg_M3[CANTP1_M3_C2_TX_STD_0X5])) ==
33584 DSMCOM_BUFFER_OVERFLOW) ;
33585 }
33586
33587 /* End of Terminate for SubSystem: '<S1067>/Std_SystemTime_01' */
33588
33589 /* Terminate for Triggered SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' */
33590
33591 /* Terminate for S-Function (rti_commonblock): '<S1064>/S-Function1' */
33592
33593 /* dSPACE RTICAN TX Message Block: "TX Message" Id:418184965 */
33594 {
33595 /* ... Set the message into sleep mode */
33596 while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep
33597 (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18ECFF05])) ==
33598 DSMCOM_BUFFER_OVERFLOW) ;
33599 }
33600
33601 /* End of Terminate for SubSystem: '<S1062>/CAN_TYPE1_TX_M1_C1' */
33602
33603 /* Terminate for Triggered SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' */
33604
33605 /* Terminate for S-Function (rti_commonblock): '<S1065>/S-Function1' */
33606
33607 /* dSPACE RTICAN TX Message Block: "TX Message" Id:418119429 */
33608 {
33609 /* ... Set the message into sleep mode */
33610 while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep
33611 (can_type1_msg_M1[CANTP1_M1_C1_TX_XTD_0X18EBFF05])) ==
33612 DSMCOM_BUFFER_OVERFLOW) ;
33613 }
33614
33615 /* End of Terminate for SubSystem: '<S1063>/CAN_TYPE1_TX_M1_C1' */
33616
33617 /* Terminate for S-Function (rti_commonblock): '<S1070>/S-Function1' */
33618
33619 /* disable digital output channel 1 on port 1 *
33620 * (set to high-impedance), when the simulation terminates */
33621 dio_tp4_digout_init(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH1,
33622 DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE);
33623
33624 /* Terminate for S-Function (rti_commonblock): '<S1071>/S-Function1' */
33625
33626 /* disable digital output channel 2 on port 1 *
33627 * (set to high-impedance), when the simulation terminates */
33628 dio_tp4_digout_init(DIO_TP4_1_MODULE_ADDR, 1, DIO_TP4_MASK_CH2,
33629 DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE);
33630
33631 /* Terminate for S-Function (rti_commonblock): '<S1072>/S-Function1' */
33632
33633 /* disable digital output channel 6 on port 2 *
33634 * (set to high-impedance), when the simulation terminates */
33635 dio_tp4_digout_init(DIO_TP4_1_MODULE_ADDR, 2, DIO_TP4_MASK_CH6,
33636 DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE);
33637
33638 /* Terminate for S-Function (rti_commonblock): '<S1073>/S-Function1' */
33639
33640 /* disable digital output channel 1 on port 2 *
33641 * (set to high-impedance), when the simulation terminates */
33642 dio_tp4_pwm_init(DIO_TP4_1_MODULE_ADDR, 2, DIO_TP4_MASK_CH1,
33643 DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE, DIO_TP4_TIMING_RANGE2,
33644 DIO_TP4_PWM);
33645
33646 /* Terminate for S-Function (rti_commonblock): '<S1074>/S-Function1' */
33647
33648 /* disable digital output channel 2 on port 2 *
33649 * (set to high-impedance), when the simulation terminates */
33650 dio_tp4_pwm_init(DIO_TP4_1_MODULE_ADDR, 2, DIO_TP4_MASK_CH2,
33651 DIO_TP4_LS_DISABLE, DIO_TP4_HS_DISABLE, DIO_TP4_TIMING_RANGE2,
33652 DIO_TP4_PWM);
33653
33654 /* Terminate for S-Function (rti_commonblock): '<S408>/S-Function1' incorporates:
33655 * SubSystem: '<S399>/Background_Task'
33656 */
33657 L4_MAB_Background_Task_Term();
33658
33659 /* End of Terminate for S-Function (rti_commonblock): '<S408>/S-Function1' */
33660
33661 /* Terminate for S-Function (rti_commonblock): '<S414>/S-Function1' incorporates:
33662 * SubSystem: '<S399>/Interrupt_Task'
33663 */
33664 L4_MABX_Interrupt_Task_Term();
33665
33666 /* End of Terminate for S-Function (rti_commonblock): '<S414>/S-Function1' */
33667
33668 /* Terminate for S-Function (rti_commonblock): '<S460>/S-Function1' */
33669
33670 /* dSPACE RTICAN STD Srvc-Message Block */
33671 {
33672 /* ... Set the message into sleep mode */
33673 while ((rtican_type1_tq_error[0][0] = can_tp1_msg_sleep
33674 (CANTP1_RX_SPMSG_M1_C1_STD)) == DSMCOM_BUFFER_OVERFLOW) ;
33675 }
33676
33677 /* dSPACE RTICAN XTD Srvc-Message Block */
33678 {
33679 /* ... Set the message into sleep mode */
33680 while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep
33681 (CANTP1_RX_SPMSG_M1_C1_XTD)) == DSMCOM_BUFFER_OVERFLOW) ;
33682 }
33683
33684 /* Terminate for S-Function (rti_commonblock): '<S461>/S-Function1' */
33685
33686 /* dSPACE RTICAN STD Srvc-Message Block */
33687 {
33688 /* ... Set the message into sleep mode */
33689 while ((rtican_type1_tq_error[0][0] = can_tp1_msg_sleep
33690 (CANTP1_RX_SPMSG_M1_C2_STD)) == DSMCOM_BUFFER_OVERFLOW) ;
33691 }
33692
33693 /* dSPACE RTICAN XTD Srvc-Message Block */
33694 {
33695 /* ... Set the message into sleep mode */
33696 while ((rtican_type1_tq_error[0][1] = can_tp1_msg_sleep
33697 (CANTP1_RX_SPMSG_M1_C2_XTD)) == DSMCOM_BUFFER_OVERFLOW) ;
33698 }
33699
33700 /* Terminate for S-Function (rti_commonblock): '<S462>/S-Function1' */
33701
33702 /* dSPACE RTICAN STD Srvc-Message Block */
33703 {
33704 /* ... Set the message into sleep mode */
33705 while ((rtican_type1_tq_error[1][0] = can_tp1_msg_sleep
33706 (CANTP1_RX_SPMSG_M2_C1_STD)) == DSMCOM_BUFFER_OVERFLOW) ;
33707 }
33708
33709 /* dSPACE RTICAN XTD Srvc-Message Block */
33710 {
33711 /* ... Set the message into sleep mode */
33712 while ((rtican_type1_tq_error[1][1] = can_tp1_msg_sleep
33713 (CANTP1_RX_SPMSG_M2_C1_XTD)) == DSMCOM_BUFFER_OVERFLOW) ;
33714 }
33715
33716 /* Terminate for S-Function (rti_commonblock): '<S463>/S-Function1' */
33717
33718 /* dSPACE RTICAN STD Srvc-Message Block */
33719 {
33720 /* ... Set the message into sleep mode */
33721 while ((rtican_type1_tq_error[1][0] = can_tp1_msg_sleep
33722 (CANTP1_RX_SPMSG_M2_C2_STD)) == DSMCOM_BUFFER_OVERFLOW) ;
33723 }
33724
33725 /* dSPACE RTICAN XTD Srvc-Message Block */
33726 {
33727 /* ... Set the message into sleep mode */
33728 while ((rtican_type1_tq_error[1][1] = can_tp1_msg_sleep
33729 (CANTP1_RX_SPMSG_M2_C2_XTD)) == DSMCOM_BUFFER_OVERFLOW) ;
33730 }
33731
33732 /* Terminate for S-Function (rti_commonblock): '<S464>/S-Function1' */
33733
33734 /* dSPACE RTICAN STD Srvc-Message Block */
33735 {
33736 /* ... Set the message into sleep mode */
33737 while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep
33738 (CANTP1_RX_SPMSG_M3_C1_STD)) == DSMCOM_BUFFER_OVERFLOW) ;
33739 }
33740
33741 /* dSPACE RTICAN XTD Srvc-Message Block */
33742 {
33743 /* ... Set the message into sleep mode */
33744 while ((rtican_type1_tq_error[2][1] = can_tp1_msg_sleep
33745 (CANTP1_RX_SPMSG_M3_C1_XTD)) == DSMCOM_BUFFER_OVERFLOW) ;
33746 }
33747
33748 /* Terminate for S-Function (rti_commonblock): '<S465>/S-Function1' */
33749
33750 /* dSPACE RTICAN STD Srvc-Message Block */
33751 {
33752 /* ... Set the message into sleep mode */
33753 while ((rtican_type1_tq_error[2][0] = can_tp1_msg_sleep
33754 (CANTP1_RX_SPMSG_M3_C2_STD)) == DSMCOM_BUFFER_OVERFLOW) ;
33755 }
33756
33757 /* dSPACE RTICAN XTD Srvc-Message Block */
33758 {
33759 /* ... Set the message into sleep mode */
33760 while ((rtican_type1_tq_error[2][1] = can_tp1_msg_sleep
33761 (CANTP1_RX_SPMSG_M3_C2_XTD)) == DSMCOM_BUFFER_OVERFLOW) ;
33762 }
33763}
33764